| missingvalues_imputation | R Documentation |
Impute missing values in a dataset using different methods.
missingvalues_imputation(dataset, method = "value", value = 5e-04, k = 5)
dataset |
A dataset object to process. |
method |
Imputation method: '"value"', '"mean"', '"median"', '"knn"', or '"linapprox"'. |
value |
If 'method = "value"', the value used to replace missing entries. |
k |
If 'method = "knn"', the number of neighbors used for imputation. |
A dataset object with the same overall structure as the input, in which missing values in 'dataset$data' have been imputed according to the selected method. The returned object preserves the dataset components and updates the description to record the imputation step.
data <- matrix(
c(1, NA, 3, 4, 5, NA),
nrow = 2,
dimnames = list(c("x1", "x2"), c("s1", "s2", "s3"))
)
dataset <- list(data = data, description = "toy dataset")
missingvalues_imputation(dataset, method = "value", value = 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.