Re: [R] Help using order with data.frame

2014-03-16 Thread arun
Try:  t[order(t$z),] #or t[with(t,order(z)),] A.K. On Sunday, March 16, 2014 12:27 AM, Jason Rupert jasonkrup...@yahoo.com wrote: Evidently, I'm overlooking something simple.  I'm trying to used order with data.frame.   For example: t = data.frame(x = c(11,12,14), y = c(19,20,21), z =

Re: [R] Help using order with data.frame

2014-03-16 Thread Jason Rupert
Thank you very much for your posts.  I updated the example, which was taken from the following: http://cran.r-project.org/doc/contrib/Torfs+Brauer-Short-R-Intro.pdf Hopefully the below is a bit more representative question, but unfortunately, it looks like I'm not inputting the dates

Re: [R] Help using order with data.frame

2014-03-16 Thread arun
Hi, Try:  data_test-data.frame(id, dates, info, sqfootage, lotsize,stringsAsFactors=FALSE)  data_test[order(with(data_test,as.Date(dates,%m/%d/%Y))),]    id dates   info sqfootage lotsize 3 ID3 2/03/2013 siding  3000    0.75 2 ID2 1/16/2014   wood  2000    0.50 1 ID1 2/16/2014 

[R] Help using order with data.frame

2014-03-15 Thread Jason Rupert
Evidently, I'm overlooking something simple.  I'm trying to used order with data.frame.   For example: t = data.frame(x = c(11,12,14), y = c(19,20,21), z = c(10,9,7)) t[order(z), ] Error in order(z) : object 'z' not found Thank you for any insights and advice provided.

Re: [R] Help using order with data.frame

2014-03-15 Thread Bert Gunter
Indeed you are -- the syntax for selecting columns of a data frame (or components from a list). Advice: Read An Introduction to R or online tutorial of your choice to learn proper syntax. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information.

Re: [R] Help using order with data.frame

2014-03-15 Thread Jeff Newmiller
It is not order that you are having difficulty with... it is name scope. Your z is not a standalone variable, but a column in your t data frame. Try t[order(t$z), ] Note that t is the name of a commonly-used function in R that transposes matrices. It is generally not a good idea to reuse

[R] Help with Order

2010-01-11 Thread Steve Sidney
Dear List As a fairly new R programmer I seem to have run into a strange problem - probably my inexperience with R After reading and merging successive files into a single data frame, I find that order does not sort the data as expected. I have multiple references in each file but each

Re: [R] Help with Order

2010-01-11 Thread Duncan Murdoch
On 11/01/2010 7:37 AM, Steve Sidney wrote: Dear List As a fairly new R programmer I seem to have run into a strange problem - probably my inexperience with R After reading and merging successive files into a single data frame, I find that order does not sort the data as expected. I have

Re: [R] Help with Order

2010-01-11 Thread David Winsemius
On Jan 11, 2010, at 7:49 AM, Duncan Murdoch wrote: On 11/01/2010 7:37 AM, Steve Sidney wrote: Dear List As a fairly new R programmer I seem to have run into a strange problem - probably my inexperience with R After reading and merging successive files into a single data frame, I find that

Re: [R] Help with Order

2010-01-11 Thread Steve Sidney
-help@r-project.org Sent: Monday, January 11, 2010 3:49 PM Subject: Re: [R] Help with Order On Jan 11, 2010, at 7:49 AM, Duncan Murdoch wrote: On 11/01/2010 7:37 AM, Steve Sidney wrote: Dear List As a fairly new R programmer I seem to have run into a strange problem - probably my inexperience