[R] intersect() question

From: Andrej Kastrin <andrej.kastrin_at_siol.net>
Date: Sun 16 Jul 2006 - 05:03:40 EST


I have a matrix containing ID numbers in each column. I would like to program function which calculate common number of ID numbers between each pair of columns.


5 6 7
1 5 3
6 7 2

Then the result should be:

0 2 0
2 0 1
0 1 0

The main problem is how to implement intersect() function to walk through each pair of columns and write result to result matrix.

Thanks in advance for any suggestion, Andrej

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jul 16 05:15:07 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 16 Jul 2006 - 06:14:47 EST.

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