Skip to contents

Mean/median/constant imputation of a numeric vector

Usage

morie_ml_impute(x, method = c("mean", "median", "constant"), value = 0)

Arguments

x

Numeric vector.

method

One of "mean", "median", "constant".

value

Fill value when method = "constant".

Value

Imputed numeric vector.

Examples

morie_ml_impute(c(1, NA, 3), "mean")
#> [1] 1 2 3