impute_missing: Impute missing values

View source: R/impute_missing.R

impute_missingR Documentation

Impute missing values

Description

Impute missing values

Usage

impute_missing(
  data,
  cols = NULL,
  method = "linear",
  group = NULL,
  date_col = NULL,
  max_gap = NULL,
  verbose = FALSE
)

Arguments

data

A data frame or matrix.

cols

Columns to impute. If NULL, all numeric columns are used.

method

"linear", "locf", "nocb", "mean", or "median".

group

Optional grouping column.

date_col

Time column.

max_gap

Not implemented; ignored with a warning.

verbose

Logical.

Value

A data frame with imputed values.

References

1. Example data is from https://smear.avaa.csc.fi/download. It includes particle number concentrations in SMEAR I Varrio forest.

Examples

impute_missing(data[1:100, c(1, 4, 17:19)], cols = 3:5, method = "locf")


dataprep documentation built on Oct. 1, 2026, 5:07 p.m.