not.na | R Documentation |
is.na()
Checks that vector elements are not NA
. This is more readable and noticeable
than !is.na(vec)
, and more compact than is.na(vec) == FALSE
.
not.na(vec)
vec |
(Vector) Any vector. |
A logical vector of the same length as vec
, with elements either
TRUE
when the element isn't NA
, or FALSE
when it is NA
.
Desi Quintans (http://www.desiquintans.com)
x <- c(1, NA, 2, 3, 4)
is.na(x)
## [1] FALSE TRUE FALSE FALSE FALSE
not.na(x)
## [1] TRUE FALSE TRUE TRUE TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.