interpolate_missing_samples: Impute missing samples using linear interpolation

Description Usage Arguments Details Value

View source: R/utils-data-processing.R

Description

Impute missing samples using linear interpolation

Usage

1
2
3
4
5
6
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)

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.

Value

the dataset, with interpolated samples


weecology/MATSS documentation built on May 15, 2020, 7:03 p.m.