View source: R/sparse_replace_na.R
sparse_replace_na | R Documentation |
Replace NAs with specified values in sparse vectors
sparse_replace_na(x, replace)
x |
A sparse vector. |
replace |
A single value. |
This function, as with any of the other helper functions assumes that the
input x
is a sparse numeric vector. This is done for performance reasons,
and it is thus the users responsibility to perform input checking.
The replace
is likewise not type or length checked.
The output type will match the values after coercion happens during replacement.
A sparse vector.
sparse_replace_na(
sparse_double(c(10, NA, 11), c(1, 5, 10), 10),
5
)
sparse_replace_na(
sparse_integer(c(10L, NA, 11L), c(1, 5, 10), 10),
5L
)
sparse_replace_na(
sparse_character(c("A", NA, "E"), c(2, 5, 10), 10),
"missing"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.