[R] intersection between two matrices based on two columns in R

Bert Gunter bgunter.4567 at gmail.com
Wed Sep 9 21:51:42 CEST 2015


I am not quite clear what you mean by "intersection", but I think

?merge

 is what you are looking for.

Cheers,
Bert

P.S. Please post in plain text, not HTML (though here it didn't matter).
Bert Gunter

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
   -- Clifford Stoll


On Wed, Sep 9, 2015 at 12:39 PM, Lida Zeighami <lid.zigh at gmail.com> wrote:
> Hi there,
>
> I want to find the intersection between two different data frame or
> matrices based on two columns.
> for example in matrix A I have 5 columns, the first two columns are Id1 and
> Id2 and I have the same columns in the other matrix B, (Id1, Id2 ,,,)
> how can I find the intersection between these two matrices based on columns
> Id1 and Id2 in R?
>
> Thanks
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.



More information about the R-help mailing list