View source: R/interpolateTS.R
interpolateTS | R Documentation |
Interpolate missing rows in time series
interpolateTS(inDT, inColID, inColFN, inColY, inFNfreq = 1L, inDeb = F)
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. |
a data.table with interpolated missing time points.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.