to_na | R Documentation |
Takes out NaN
and Inf
and replaces them with NA
to_na(x)
x |
a vector |
Returns vector with replaced NA
values.
Daniel Luettgau
test <- list(a = c("a", "b", NA),
b = c(NaN, 1,2, -Inf),
c = c(TRUE, FALSE, NA))
lapply(test, to_na)
## Output
# $a
# [1] "a" "b" NA
# $b
# [1] NA 1 2 NA
# $c
# [1] TRUE FALSE NA
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.