[R] Sorting a dataframe by one column?

2006-02-24 Thread mtb954 mtb954
Given the following dataframe: A=1:10 B=(a-5)^2 DATAFRAME=data.frame(A,B) How can I sort DATAFRAME increasing (or decreasing, for that matter) by B without making reference to A, or any other column? I've read ?order and ?sort but cannot seem to figure this out. Thank you. Mark

Re: [R] Sorting a dataframe by one column?

2006-02-24 Thread michael watson \(IAH-C\)
You mean like this? a-1:10 b-(a-5)^2 d-data.frame(a,b) d[order(d$b),] ?? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of mtb954 mtb954 Sent: 24 February 2006 13:55 To: r-help@stat.math.ethz.ch Subject: [R] Sorting a dataframe by one column? Given

Re: [R] Sorting a dataframe by one column?

2006-02-24 Thread Chuck Cleland
mtb954 mtb954 wrote: Given the following dataframe: A=1:10 B=(a-5)^2 DATAFRAME=data.frame(A,B) How can I sort DATAFRAME increasing (or decreasing, for that matter) by B without making reference to A, or any other column? I've read ?order and ?sort but cannot seem to figure this out.

Re: [R] Sorting a dataframe

2003-08-14 Thread Spencer Graves
Why won't order solve your problem? ?order in R 1.7.1 for Windows includes an example sorting lexicographically 3 variables in ascending order. spencer graves Paul, David A wrote: Undoubtedly a simple question: I've looked at order() and sort() in the help pages for R1.7.1. It doesn't

[R] Sorting a dataframe

2003-08-14 Thread Paul, David A
Undoubtedly a simple question: I've looked at order() and sort() in the help pages for R1.7.1. It doesn't appear that these functions are immediately suited to doing the same thing as PROC SORT DATA = BLAH; BY X Y Z; RUN; in SAS. I have also checked Frank Harrell's Hmisc library.

RE: [R] Sorting a dataframe

2003-08-14 Thread Hotz, T.
:[EMAIL PROTECTED] Sent: 12 August 2003 17:39 To: '[EMAIL PROTECTED]' Subject: [R] Sorting a dataframe Undoubtedly a simple question: I've looked at order() and sort() in the help pages for R1.7.1. It doesn't appear that these functions are immediately suited to doing the same thing

Re: [R] Sorting a dataframe

2003-08-14 Thread Marc Schwartz
On Tue, 2003-08-12 at 11:38, Paul, David A wrote: Undoubtedly a simple question: I've looked at order() and sort() in the help pages for R1.7.1. It doesn't appear that these functions are immediately suited to doing the same thing as PROC SORT DATA = BLAH; BY X Y Z; RUN; in