Linear interpolation
In R, use the approx function.
- x is the original x data
- y is the original y data
- xi is the x data you want new y data for.
z = approx(x, y, xi)
plot(z)
plot(z$x, z$y) # does the same thing.
See ?approx for more options.
Tags: interpolation, R, time series