Re: [R] combining two data frames (different question)

From: John Kane <jrkrideau_at_yahoo.ca>
Date: Thu, 19 Jun 2008 12:11:29 -0700 (PDT)


This depends on the id column. If all the id's are the same and in the exact same order then look at ?cbind.

If you have different numbers or different ids in the two id columns see ?merge

> From: calundergrad <haibinglin_at_berkeley.edu>
> Subject: [R] combining two data frames (different question)
> To: r-help_at_r-project.org
> Received: Tuesday, June 17, 2008, 6:40 PM
> i have two data frames. One data frame contains one column
> with the
> identificication number of a geographic place. The other
> columns are just
> some data about the corresponding geographic place. The
> other data frame
> also contains one column with the id number of a geographic
> place. the
> other columns of the second data frame is other data about
> the corresponding
> geographic place.
>
> I want to make one data frame which has the id numbers and
> the corresponding
> data from both the first and second data frames.
>
> how do you do this?
> --
> View this message in context:
> http://www.nabble.com/combining-two-data-frames-%28different-question%29-tp17956259p17956259.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.



[[elided Yahoo spam]]

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 19 Jun 2008 - 19:46:26 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 19 Jun 2008 - 20:32:41 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive