[R] order two dataframes by an integer column from either data frame

Dieter Menne dieter.menne at menne-biomed.de
Fri Feb 19 16:53:45 CET 2010



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.



More information about the R-help mailing list