Impute missing samples using linear interpolation

interpolate_missing_samples(
  data,
  period = NULL,
  tol = 1e-06,
  interpolate_covariates = FALSE
)

Arguments

data

dataset to modify

period

period to check the times against (if NULL, first check to see if there is a known period set in the metadata, otherwise assumes 1)

tol

tolerance for the period

interpolate_covariates

TRUE or FALSE (whether to do covariates, too)

Value

the dataset, with interpolated samples

Details

First, check if the data are evenly sampled in time. If not, we exit early. Next, apply forecast::na.interp() to each variable that has non-finite values.