View source: R/trans_imputation_simple.R
| imputation_simple | R Documentation |
Impute missing values in numeric columns using the mean or median.
imputation_simple(method = c("median", "mean"), cols = NULL)
method |
imputation method: "median" or "mean" |
cols |
optional vector of column names to impute (default: all numeric columns) |
returns an object of class imputation_simple
data(iris)
iris_na <- iris
iris_na$Sepal.Length[c(2, 10, 25)] <- NA
imp <- imputation_simple(method = "median")
imp <- fit(imp, iris_na)
iris_imp <- transform(imp, iris_na)
summary(iris_imp$Sepal.Length)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.