| impute_nas_value | R Documentation |
Replace all 'NA' values in 'dataset$data' by a user-defined constant.
impute_nas_value(dataset, value)
dataset |
A dataset object to modify. |
value |
A numeric or character value used to replace missing entries. |
A dataset object with the same structure as the input, where all missing values in 'dataset$data' have been replaced by 'value'. Other components of the dataset are preserved unchanged.
data <- matrix(
c(1, NA, 3, 4),
nrow = 2,
dimnames = list(c("x1", "x2"), c("s1", "s2"))
)
dataset <- list(data = data)
impute_nas_value(dataset, 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.