R: Interpolate missing values in a time series

na.interp {forecast} | R Documentation

## Interpolate missing values in a time series

### Description

Uses linear interpolation for non-seasonal series and a periodic stl decomposition with seasonal series to replace missing values.

### Usage

    na.interp(x, lambda = NULL)

### Arguments

`x` | time series
`lambda` | a numeric value suggesting Box-cox transformation

### Details

A more general and flexible approach is available using `na.approx` in the `zoo` package.

### Value

Time series

### Author(s)

Rob J Hyndman

### See Also

`na.interp`, `tsoutliers`

### Examples

    data(gold)
    plot(na.interp(gold))

[Package forecast version 8.0 Index]