impute_nas_value: Impute missing values with a constant

impute_nas_valueR Documentation

Impute missing values with a constant

Description

Replace all 'NA' values in 'dataset$data' by a user-defined constant.

Usage

impute_nas_value(dataset, value)

Arguments

dataset

A dataset object to modify.

value

A numeric or character value used to replace missing entries.

Value

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.

Examples

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)


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