[R] union of a list of logical values

2013-07-22 Thread Liviu Andronic
Dear all, How can I obtain the union of a list of logical values? Consider the following: x - head(iris) x[,c(2,4)] - NA x[c(2,4),] - NA # x # Sepal.Length Sepal.Width Petal.Length Petal.Width Species # 1 5.1 NA 1.4 NA setosa # 2 NA NA

Re: [R] union of a list of logical values

2013-07-22 Thread Prof Brian Ripley
On 22/07/2013 10:16, Liviu Andronic wrote: Dear all, How can I obtain the union of a list of logical values? This really only makes sense for a list of logical vectors of the same length. And by 'union' you seem to mean 'or'. Two approaches 1) Make a logical matrix and use apply(m, 1,

Re: [R] union of a list of logical values

2013-07-22 Thread Liviu Andronic
On Mon, Jul 22, 2013 at 11:37 AM, Prof Brian Ripley rip...@stats.ox.ac.uk wrote: This really only makes sense for a list of logical vectors of the same length. And by 'union' you seem to mean 'or'. Indeed. Two approaches 1) Make a logical matrix and use apply(m, 1, any) Of course! I