View source: R/impute_missing_data.R
impute_missing_data | R Documentation |
Given an input matrix, impute the missing values via three approaches including mean, median or zero.
impute_missing_data(x, method = c("mean", "median", "zero"))
x |
A numeric matrix as input. |
method |
Imputation method for missing values (mean, median or zero). |
impute_missing_data
Imputed matrix.
Matineh Rahmatbakhsh matinerb.94@gmail.com
x <- matrix(1:10, ncol = 2)
x[1:3, 2] <- NA
row.names(x) <- c("A", "B", "C", "D", "E")
colnames(x) <- c("col1", "col2")
impute_missing_data(x, method = "mean")
impute_missing_data(x, method = "median")
impute_missing_data(x, method = "zero")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.