[R] or of a logical vector

Liaw, Andy andy_liaw at merck.com
Thu Aug 5 22:23:17 CEST 2004


Yes, of course:

> x <- c(TRUE, NA)
> any(x)
[1] TRUE
> sum(x) > 0
[1] NA

Andy

> From: Peter Dalgaard  
> 
> "Liaw, Andy" <andy_liaw at merck.com> writes:
> 
> > Is there anything wrong with sum(v) > 0?
> 
> Yes, there is an any()-thing.... ;-)
> 
> (And NA handling differs too.)
> 
> -- 
>    O__  ---- Peter Dalgaard             Blegdamsvej 3  
>   c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
>  (*) \(*) -- University of Copenhagen   Denmark      Ph: 
> (+45) 35327918
> ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: 
> (+45) 35327907
> 
>




More information about the R-help mailing list