| impute_nas_median | R Documentation |
Replace missing values in each variable by the median of the observed values for that variable.
impute_nas_median(dataset)
dataset |
A dataset object to modify. |
A dataset object with the same structure as the input, where missing values in 'dataset$data' have been replaced by the median of the corresponding variable calculated with 'na.rm = TRUE'.
data <- matrix(
c(1, NA, 5, 4),
nrow = 2,
dimnames = list(c("x1", "x2"), c("s1", "s2"))
)
dataset <- list(data = data)
impute_nas_median(dataset)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.