any {base} | R Documentation |
Given a set of logical vectors, are any of the values true?
any(..., na.rm = FALSE)
... |
one or more logical vectors. |
na.rm |
logical. If true |
Given a sequence of logical arguments, a logical value indicating
whether or not any of the elements of x
are TRUE
.
The value returned is TRUE
if any the values in x
are TRUE
, and FALSE
if all the values in x
are FALSE
.
If x
consists of a mix of FALSE
and NA
values,
the value is NA
.
all
, the “complement” of any
.
range(x <- sort(round(rnorm(10) - 1.2,1)))
if(any(x < 0)) cat("x contains negative values\n")