[R] intersection on more than two sets

2010-06-03 Thread amir
Hi, I want to do an intersection or union on more than two sets. Is there any command to do this? Regards, Amir __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] intersection on more than two sets

2010-06-03 Thread jim holtman
?Reduce x - function(z) Reduce('union', z) x(list(1:3, 4:6)) [1] 1 2 3 4 5 6 x(list(1:3, 4:6, 3:7)) [1] 1 2 3 4 5 6 7 x - function(z) Reduce('intersect', z) x(list(1:3, 4:6, 3:7)) integer(0) x(list(1:3, 2:6, 3:7)) [1] 3 On Thu, Jun 3, 2010 at 3:59 AM, amir a...@ac.upc.edu wrote: Hi, I