Description Usage Arguments Value See Also Examples
impute
returns a vector of values imputed from resampling x
.
1 | impute_sample(x, n = 1, replace = TRUE)
|
x |
A vector. |
n |
The number of values to impute. |
replace |
Whether or not to sample with replacement. The default is TRUE. |
The output of impute_sample
is a vector of imputed values of length n
Other imputers: impute_ecdf
,
impute_mode
, impute
1 2 3 4 5 6 7 | x <- c("mode", "mode", "other", NA, NA)
# Impute via sampling
x_impute <- impute(x, impute_sample)
# Compare
data.frame(x, x_impute)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.