[S-News] SUMMARY - Sorting by one variable

Paul Monaghan (pfm@scmp.scm.liv.ac.uk)
Thu, 5 Feb 1998 12:44:48 +0000 (GMT)


Thanks to all who responded so quickly to my query, namely Christian Keller, Duncan Murdoch,
Suchurita Ghosh, G.S. Collins and Goran Brostom, and others who may have sent mail before
receiving this message.

The answer is to use the function order. In my dataframe/matrix (data) with the three variables
time,drug,status, I want to sort by time whilst preserving rows. This is done by the command

data[order(data$time),]

Easy when you know how!

Regards, Paul Monaghan.
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news