RE: [R] Intersection of more than two groups in one function?

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Fri 06 May 2005 - 06:21:40 EST


Here's a brute-force approach:

> "%i%" <- intersect
> x1 <- c(1, 3, 4, 7)
> x2 <- c(3, 7, 8)
> x3 <- c(7, 1)
> x1 %i% x2 %i% x3


[1] 7

Andy

> From: Ken Termiso
>
> Hi all,
>
> As far as I can tell, the only canned way to do an intersect
> between two
> vectors of ints is the intersect(vec1, vec2) function -- is
> there another
> function I'm missing for intersecting more than two vectors??
>
> TIA,
> Ken
>
> ______________________________________________
> 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
>
>
>



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 Fri May 06 06:44:03 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:36 EST