Re: [R] union of two data frames

From: Erik Iverson <iverson_at_biostat.wisc.edu>
Date: Mon, 25 Feb 2008 16:13:08 -0600

Perhaps this example might help you?

I create 2 sample data.frames, take a look at what they contain and then what the merge function gives. Compare with all = FALSE.

df1 <- data.frame(a = 1:10, b = 11:20)
df2 <- data.frame(a = c(1:2,98), b = c(11:12, 99))

merge(df1, df2, all = TRUE)

Erik Iverson wrote:
> You probably need to provide an example here, show us your data.frame
> column names, and what you mean by 'common subset of the same data' at
> least. What did you try and what did it do that you didn't expect?
>
> stephen sefick wrote:

>> I have a thirty thousand row data frame imported from excel and a
>> 60,000 row data frame imported from excel.  they share a common subset
>> of the same data and I would like to combine the two into one data
>> frame merged together on the data in common.  I have looked at the
>> help file for merge and intersect and cbind and rbind etc... And I
>> can't figure it out.  Thanks in advance
>>
>> Stephen
>>

>
> ______________________________________________
> 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.


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 Mon 25 Feb 2008 - 22:17:34 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 Mon 25 Feb 2008 - 22:30:17 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