Description Usage Arguments Value Examples
Check whether a list contains NA or not.
1 |
alist |
A list constructed by numeric vectors, which possibly contained in NAs. |
A logical, if list contains NA, then TRUE. And False for the others.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | #========================================================================================
# If a list does not contain NAs, then return TRUE
#========================================================================================
#'d <- list(a=c(1,1),aa = c(2,2),aaa =c(3,3,3))
is_na_list(d)
#========================================================================================
# If a list contains NAs, then return TRUE
#========================================================================================
d <- list(a=c(NA,1),aa = c(2,2),aaa =c(3,3,3))
is_na_list(d)
#========================================================================================
# Note that a data frame is a list of equal-length vectors
#========================================================================================
d <- is_na_list(data.frame(c(1,1)))
is_na_list(d)
d <- is_na_list(data.frame(c(1,NA)))
is_na_list(d)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.