View source: R/impute_by_sampling_distribution.r
impute_by_sampling_distribution | R Documentation |
This function take advantage of generate_synthetic_object
to impute
missing data. Read help(generate_synthetic_object)
for more information.
impute_by_sampling_distribution(obj, set_seed = NULL)
obj |
A dataframe, numeric vector or character/factor vector. |
seed |
Specify seed when replication is desired. |
The same object without NA values as they have been imputed.
impute_by_sampling_distribution(c(mtcars$mpg,NA,NA,NA,NA,NA))
data_temp <- data.frame(
x = c(mtcars$mpg,NA,NA,NA,NA,NA),
y = c(mtcars$cyl,NA,NA,NA,NA,NA))
as.data.frame(impute_by_sampling_distribution(data_temp) )
dplyr::mutate(data_temp, x_impute = impute_by_sampling_distribution(x))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.