[R] question of merging two dataframes

Bert Gunter gunter.berton at gene.com
Tue Jan 31 23:30:49 CET 2012


On Tue, Jan 31, 2012 at 2:24 PM, Tal Galili <tal.galili at gmail.com> wrote:
> Hi there,
> The command for merging is:
> merge
>

A fortunes candidate?

-- Bert




> Can you please clarify by which variable you wish to merge by?
> Can you maybe use ?dput function in order to give a self contained R code
> example of your data - and the output you wish to get?
>
>
> Best,
> Tal
>
>
>
> ----------------Contact
> Details:-------------------------------------------------------
> Contact me: Tal.Galili at gmail.com |  972-52-7275845
> Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) |
> www.r-statistics.com (English)
> ----------------------------------------------------------------------------------------------
>
>
>
>
> On Tue, Jan 31, 2012 at 8:51 PM, freezhu8 <freezhu8 at gmail.com> wrote:
>
>> Suppose I have two data frames A and B
>> A has three variables and B also has three variables.
>> I would like to merge these two database but the requirement to merge
>> is that the value of the second column in database A is less than the
>> value of the second column in database B. Is there a R code to do
>> this? Thanks
>>
>> Dataframe A:   V1a   V2a   V3a
>>                   1  2      3         5
>>                   2  3      4         6
>>                   3
>> Dataframe B:   V1b  V2b V3b
>>                  1  2       5      9
>>                  2  9       2      7
>> Dataframe C should be:   V1a   V2a  V3a  V1b   V2b   V3b
>>                                 1  2        3      5      2       5       9
>>
>> --
>> View this message in context:
>> http://r.789695.n4.nabble.com/question-of-merging-two-dataframes-tp4345469p4345469.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.
>>
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> 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.



-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm



More information about the R-help mailing list