Re: [R] Keeping the order of data set when plotting

2010-03-01 Thread Jim Lemon
On 03/02/2010 01:53 PM, cosinenonqua wrote: I have a data frame with 3 columns and I want to order the entire list by one column and then plot. I used order() and it does order the data set but when I plot it is as if the set is as it was originally. I also can't figure out how to plot two sets

Re: [R] Keeping the order of data set when plotting

2010-03-01 Thread Dennis Murphy
Hi: order() simply returns the index vector that corresponds to the ordering, not the ordering per se. Besides, when you read in the data, Occupation is read in as a factor that will by default order the levels alphabetically. If you want a different ordering, you can redefine the factor; e.g., d

Re: [R] Keeping the order of data set when plotting

2010-03-01 Thread jim holtman
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Can you provide the data and the commands that you were using. When providing the data, please use 'dput'. Most likely it might be because one of the th

[R] Keeping the order of data set when plotting

2010-03-01 Thread cosinenonqua
I have a data frame with 3 columns and I want to order the entire list by one column and then plot. I used order() and it does order the data set but when I plot it is as if the set is as it was originally. I also can't figure out how to plot two sets of data on the same graph. I have, Occupation