View source: R/impute_missing.R
impute_missing | R Documentation |
Replace NA
s in numeric variables using simple methods or mice
-based imputation.
impute_missing(
data,
method = c("mean", "median", "mice"),
m = 5,
seed = 123,
...
)
data |
A numeric matrix or data frame. |
method |
Character; one of |
m |
Integer; number of multiple imputations when |
seed |
Integer; random seed for |
... |
Additional arguments passed to |
A data frame with missing values imputed.
## Not run:
df <- data.frame(x = c(1, NA, 3), y = c(4, 5, NA))
impute_missing(df, method = "mice")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.