Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.GSO.4.05.10211081601160.17352-100000@engmail.uwaterloo.ca>
Date: 2002-11-08T21:05:35Z
From: Paul Boutros
Subject: Merging data.frames

Is it possible to combine two data-frames, just taking the rows where
these frames have equivalent names?
So for example I would want to take:

d1:
  val1 val2
A  1    2
B  3    4
C  5    6

and d2:
  val3 val4
A  1    4
C  2    5
D  3    6

to merge into:
  val1 val2 val3 val4
A  1    2    1    4
C  5    6    2    5

Is this kind of "merge on equal rows" to create a subset of the two
data-frames possible in R, or would I need to move to an altnerate
lagnauge to do this?

Thanks for any ideas!
Paul

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._