[R] using reorder in dotplot

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Mar 26 12:03:43 CET 2010


On Tue, Mar 23, 2010 at 7:21 AM, Veerappa Chetty <chettyvk at gmail.com> wrote:
> Hi,
> Please help to correct my error in the following. I want to plot the values
> of 'x" in increasing order.
> -----------------------------------
> library(lattice)
> Name<-c("A","B","C")
> x<-c(15,20,10)
> test<-data.frame(Name,x)
> dotplot(Name~x,test)
> dotplot(reorder(Name,x)~x,test)
>
> "reorder" has no effect!

It has for me:

> Name
[1] "A" "B" "C"
> reorder(Name,x)
[1] A B C
attr(,"scores")
 A  B  C
15 20 10
Levels: C A B

Are you using a recent enough R?

-Deepayan



More information about the R-help mailing list