[Thank-you] [R] Help: sorting data frames

From: Barry Rountree <rountree_at_cs.uga.edu>
Date: Tue 15 Feb 2005 - 08:56:10 EST


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

Back in 2002, you answered a question posted to the r-help mailing list, something like:

> Hello everyone:
> I have a data frame with two columns of data. I want to create a new
> data frame, in which the first column is sorted in accending order, and
> the elements of the second column are properly re-ordered (to be in the
> same row with their corresponding first column elements)

R> mydf[order(mydf[,1]),]

Torsten

That was exactly the question I had, the answer was exactly what I needed, and I appreciate you taking the trouble to answer it publicly.

Thanks,

Barry Rountree
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCER56hlM7FvEcdO8RAtvGAJ0T7urq8lBjIGQ465anqV7KaovnTwCdGpo2 BbdDRnqc43maaBdzoqa80sY=
=ZPHp
-----END PGP SIGNATURE-----



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Feb 15 08:15:02 2005

This archive was generated by hypermail 2.1.8 : Tue 15 Feb 2005 - 11:22:00 EST