InterpolateMissingValues: InterpolateMissingValues

View source: R/InterpolateMissingValues.R

InterpolateMissingValuesR Documentation

InterpolateMissingValues

Description

Interpolates missing values, by setting them NaN and then applying spline interpolation

Usage

InterpolateMissingValues(Time, Datavector, option = "stine",

PlotIt = TRUE)

Arguments

Time

[1:n] vector of time, POSIXlt or POSIXct are accepted

Datavector

[1:n] numerical vector of data

option

See na.interpolation. Default is "stine"

PlotIt

TRUE: Evaluates output of function versus input by plots. Default is TRUE

Details

Wrapper for InterpolateOutliers. Missing values are all values which are not is.finite(Datavector)==TRUE.

Value

[1:n] interpolated vector of data

Author(s)

Michael Thrun

See Also

InterpolateOutliers

Examples

data("airquality")
which(!is.finite(airquality$Ozone))

date_strings = paste("1973", airquality$Month, airquality$Day, sep = "-")
dates = as.Date(date_strings)

vals = InterpolateMissingValues(dates, airquality$Ozone)

Mthrun/TimeSeries documentation built on Feb. 6, 2024, 9:23 a.m.