Diberikan sekumpulan vektor logis, apakah semua nilainya benar?
all(…, na.rm = FALSE)
| Parameter | Deskripsi |
|---|---|
… |
zero or more logical vectors. Other objects of zero length are ignored, and the rest are coerced to logical ignoring any class. |
na.rm |
logical. If true NA values are removed before the result is computed. |
# NOT RUN {
range(x <- sort(round(stats::rnorm(10) - 1.2, 1)))
if(all(x < 0)) cat("all x values are negative\n")
all(logical(0)) # true, as all zero of the elements are true.
# }