Re: [R] plot is not keeping the order of variable

2010-02-22 Thread Peter Dalgaard
Dieter Menne wrote: Peter Dalgaard wrote: d <- data.frame(f=c("rare", "medium","well-done")) #To get the cast in order of appearance, this can be used: > d$f <- factor(d$f, levels=unique(d$f)) > d$f [1] rare mediumwell-done Levels: rare medium well-done .. which caused some head

Re: [R] plot is not keeping the order of variable

2010-02-21 Thread Or Duek
Thank you very much, You solved my problem. On Mon, Feb 22, 2010 at 12:42 AM, Peter Dalgaard wrote: > Or Duek wrote: > >> Ok, >> It seems that the problem lays in the order (as Ista mentioned), >> But, when I ask R to order it he chooses to order it by size and not by >> the >> specific order I m

Re: [R] plot is not keeping the order of variable

2010-02-21 Thread Dieter Menne
Peter Dalgaard wrote: > > d <- data.frame(f=c("rare", "medium","well-done")) > #To get the cast in order of appearance, this can be used: > > > d$f <- factor(d$f, levels=unique(d$f)) > > d$f > [1] rare mediumwell-done > Levels: rare medium well-done > > .. which caused some head-s

Re: [R] plot is not keeping the order of variable

2010-02-21 Thread Peter Dalgaard
Or Duek wrote: Ok, It seems that the problem lays in the order (as Ista mentioned), But, when I ask R to order it he chooses to order it by size and not by the specific order I mentioned when I built the vector. Is it possible to tell him to keep the order as mentioned? Thank you. You're still

Re: [R] plot is not keeping the order of variable

2010-02-21 Thread Don MacQueen
Perhaps this example will help. x <- factor(c('b','a','d'), levels=c('a','d','b')) y <- 1:3 plot(x,y) And compare with z <- factor(c('b','a','d')) plot(z,y) In the first, the plot is in the order that I chose. In the second it is in the order that R chose -- and R chose it according

Re: [R] plot is not keeping the order of variable

2010-02-21 Thread Or Duek
Ok, It seems that the problem lays in the order (as Ista mentioned), But, when I ask R to order it he chooses to order it by size and not by the specific order I mentioned when I built the vector. Is it possible to tell him to keep the order as mentioned? Thank you. On Sun, Feb 21, 2010 at 6:16 P

Re: [R] plot is not keeping the order of variable

2010-02-21 Thread Ista Zahn
Hi Or, I can't know for sure what your problem is without an example, but the first thing I would do is check to make sure that your labels are stored as an ordered factor (and that the order is correct). See ?factor for details. Best, Ista On Sun, Feb 21, 2010 at 10:57 AM, Or Duek wrote: > Hi,

[R] plot is not keeping the order of variable

2010-02-21 Thread Or Duek
Hi, I created a simple data frame with one factor and one numerical variable. The factor was actually a vector of names of techniques to trimm reaction time data. I want to create a plot that shows the value of F test for every trimming method. So the data frame has its trim factor (who has those l