Skip to content
Back to formatted view

Raw Message

Message-ID: <39B6DDB9048D0F4DAD42CB26AAFF0AFA076EDB@usctmx1106.merck.com>
Date: 2005-05-05T20:21:40Z
From: Liaw, Andy
Subject: Intersection of more than two groups in one function?

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 at 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
> 
> 
>