[R] An R clause to bind dataframes under certain contions

Henrique Dallazuanna wwwhsd at gmail.com
Sat Jan 26 21:22:43 CET 2008


Try this:

merge(x, y, all=T)


On 26/01/2008, zhihuali <lzhtom at hotmail.com> wrote:
>
> Hi netters,
> Suppose I have two data frames X and Y. X has three colnames A, B and C. Y has three colnames A,B and D.
>
> I want to combine them into one matrix, joining the rows having the same A and B values (X$A==Y$A and X$B = Y$B). So the resulting dataframe has four variables/columns: A,B,C and D.
>
> I was wondering what's the best way to do it in R.  Could anyone give me some advice?
>
> Thanks!
>
> Zhihua Li
>
>
> _________________________________________________________________
> 手机也能上 MSN 聊天了,快来试试吧!
>
>         [[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.
>
>


-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O


More information about the R-help mailing list