interpolateTS: Interpolate missing rows in time series

View source: R/interpolateTS.R

interpolateTSR Documentation

Interpolate missing rows in time series

Description

Interpolate missing rows in time series

Usage

interpolateTS(inDT, inColID, inColFN, inColY, inFNfreq = 1L, inDeb = F)

Arguments

inDT

a data.table with time series in the long format.

inColID

a string with the name of the column with unique time series IDs.

inColFN

a string with the name of the column with integer frame numbers.

inColY

a string or a vector of strings with column names of numerical columns to interpolate.

inFNfreq

an integer with the interval between frames.

inDeb

logical, whether to output debug information.

Value

a data.table with interpolated missing time points.

Examples

library(ARCOS)
library(data.table)

dt = data.table(t = c(1,2,3,5,6,7),
                y = c(1,2,3,5,6,7),
                id = rep(1, 6))

dtInt = ARCOS:::interpolateTS(inDT = dt,
                      inColID = "id",
                      inColFN = "t",
                      inColY = "y",
                      inFNfreq = 1)

                      plot(dt$t, dt$y, type = "p")
                      points(dtInt$t, dtInt$y, col = "red", pch = 3)


dmattek/ARCOS documentation built on Dec. 5, 2024, 11:02 p.m.