missingvalues_imputation: Missing values imputation

missingvalues_imputationR Documentation

Missing values imputation

Description

Impute missing values in a dataset using different methods.

Usage

missingvalues_imputation(dataset, method = "value", value = 5e-04, k = 5)

Arguments

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.

Value

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.

Examples

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)


specmine documentation built on Aug. 5, 2026, 5:06 p.m.