Description Usage Arguments Details Value See Also Examples
Test if all values are missing
1 2 3 4 5 6 7 8 9 10 |
x |
object to test. |
These are S3 Generics that provide default methods.
all_na
reports if all values are missing.
any_na
reports if any values are missing. If always returns a logical
scalar.
is_na
is a wrapper around base::is.na()
created to keep stylistic
consistenct with the other functions.
which_na
is implemented as which( is.na(x) )
.
It is a S3 generic function.
logical scalar indicating if values are missing.
logical scalar; either TRUE or FALSE.
integer
of indexes of x
that corerspond to elements
of x that are missing (NA
). Names of the result
are set to the names of x
.
base::anyNA()
base::is.na()
- for the variant returning logical
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | all_na( c( NA, NA, 1 ) ) # FALSE
all_na( c( NA, NA, NA ) ) # TRUE
df <- data.frame( char = rep(NA_character_, 3), nums=1:3)
all_na(df) # FALSE
df <- data.frame( char = rep(NA_character_, 3), nums=rep(NA_real_,3))
all_na(df) # TRUE
any_na( 1:10 ) # FALSE
any_na( c( 1, NA, 3 ) ) # TRUE
x <- c( 1, NA, NA, 4:6 )
which_na(x)
names(x) <- letters[1:6]
which_na(x)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.