Paul Rigor (ucla)
2010-Feb-19 15:45 UTC
[R] order two dataframes by an integer column from either data frame
Hi, I'm an R nooob! So please pardon this easy question! I have two data frames that share a common column, data1.name and data2.name. How would I be able to order the other based on an integer column from either data frame? For example, how do I order data2 based on data1.age? Or data1 based on data2.salary? Thanks! Paul -- Paul Rigor Pre-doctoral BIT Fellow and Graduate Student Institute for Genomics and Bioinformatics Donald Bren School of Information and Computer Sciences University of California, Irvine http://www.ics.uci.edu/~prigor [[alternative HTML version deleted]]
Dieter Menne
2010-Feb-19 15:53 UTC
[R] order two dataframes by an integer column from either data frame
Paul Rigor (ucla) wrote:> > I have two data frames that share a common column, data1.name and > data2.name. > How would I be able to order the other based on an integer column from > either data frame? > > For example, how do I order data2 based on data1.age? Or data1 based on > data2.salary? > >I would ?merge the two on the common columns, and sort the merged. You could get around the merge, but it's easier to understand that way. Dieter -- View this message in context: http://n4.nabble.com/order-two-dataframes-by-an-integer-column-from-either-data-frame-tp1561815p1561827.html Sent from the R help mailing list archive at Nabble.com.