Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

reinterpolate

Wrapper for simple linear reinterpolation


Description

This function is just a wrapper for the native function stats::approx() to do simple linear reinterpolation. It also supports matrices, data frames, and lists of time series.

Usage

reinterpolate(x, new.length, multivariate = FALSE)

Arguments

x

Data to reinterpolate. Either a vector, a matrix/data.frame where each row is to be reinterpolated, or a list of vectors/matrices.

new.length

Desired length of the output series.

multivariate

Is x a multivariate time series? It will be detected automatically if a list is provided in x.

Details

Multivariate series must have time spanning the rows and variables spanning the columns.

Value

Reinterpolated time series

Examples

data(uciCT)

# list of univariate series
series <- reinterpolate(CharTraj, 205L)

# list of multivariate series
series <- reinterpolate(CharTrajMV, 205L)

# single multivariate series
series <- reinterpolate(CharTrajMV[[1L]], 205L, TRUE)

dtwclust

Time Series Clustering Along with Optimizations for the Dynamic Time Warping Distance

v5.5.10
GPL-3
Authors
Alexis Sarda-Espinosa
Initial release
2022-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.