na_omitlist | R Documentation |
This functions removes NA
s from a list. With recursive =
TRUE
, NA
s within each list's elements are removed as well.
na_omitlist(y = list(), recursive = FALSE)
y |
a list |
recursive |
logical. If |
Returns the list without NA
s.
Jakob Gepp
y <- list(c(1:3), letters[1:4], NA, c(1, NA), list(c(5:6, NA), NA, "A"))
na_omitlist(y, recursive = TRUE)
# [[1]]
# [1] 1 2 3
#
# [[2]]
# [1] "a" "b" "c" "d"
#
# [[3]]
# [1] 1
#
# [[4]]
# [[4]][[1]]
# [1] 5 6
#
# [[4]][[2]]
# [1] "A"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.