na.interp | R Documentation |
By default, uses linear interpolation for non-seasonal series. For seasonal series, a robust STL decomposition is first computed. Then a linear interpolation is applied to the seasonally adjusted data, and the seasonal component is added back.
na.interp(
x,
lambda = NULL,
linear = (frequency(x) <= 1 | sum(!is.na(x)) <= 2 * frequency(x))
)
x |
time series |
lambda |
Box-Cox transformation parameter. If |
linear |
Should a linear interpolation be used. |
A more general and flexible approach is available using na.approx
in
the zoo
package.
Time series
Rob J Hyndman
tsoutliers
data(gold)
plot(na.interp(gold))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.