Is there anything wrong with sum(v) > 0?
Andy
> From: Ben Wittner
>
> Is there some fast (built-in?) way to get the OR of all the
> elements in a
> logical vector?
>
> In other words, is there some fast (built-in) version of the
> function vor
> below?
>
> Thanks.
>
> -Ben
>
> vor <- function(v) {
> ans <- v[1]
> if (length(v) > 1)
> for (i in 2:length(v))
> ans <- ans | v[i]
> ans
> }
>
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
>
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html