na_StructTS: Fill NA or specified positions.

Description Usage Arguments Details See Also Examples

View source: R/na_StructTS.R

Description

Generic function for filling NA values using seasonal Kalman filter.

Usage

1
na_StructTS(object, ...)

Arguments

object

an object.

...

other arguments passed to methods.

na_rm

logical. Whether to remove end portions or fill them with NA.

maxgap

Runs of more than maxgap NAs are retained, other NAs are removed and the last occurrence in the resulting series prior to each time point in xout is used as that time point's output value.

Details

Interpolate with seasonal Kalman filter. The input object should have a frequency. It is assumed the cycle length is 1.

See Also

na_approx

Examples

1
2
3
4
5
6
7
z <- zooreg(rep(10 * seq(4), each = 4) + rep(c(3, 1, 2, 4), times = 4), 
	start = as.yearqtr(2000), freq = 4)
z[10] <- NA

zout <- na_StructTS(z)

plot(cbind(z, zout), screen = 1, col = 1:2, type = c("l", "p"), pch = 20)

decisionpatterns/na.actions documentation built on Aug. 25, 2020, 8:04 p.m.