EVOLUTION-MANAGER
Edit File: na.StructTS.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Fill NA or specified positions.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for na.StructTS {zoo}"><tr><td>na.StructTS {zoo}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Fill NA or specified positions.</h2> <h3>Description</h3> <p>Generic function for filling <code>NA</code> values using seasonal Kalman filter.</p> <h3>Usage</h3> <pre> na.StructTS(object, ...) ## S3 method for class 'ts' na.StructTS(object, ..., na.rm = FALSE, maxgap = Inf) ## S3 method for class 'zoo' na.StructTS(object, ..., na.rm = FALSE, maxgap = Inf) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>object</code></td> <td> <p>an object.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>other arguments passed to methods.</p> </td></tr> <tr valign="top"><td><code>na.rm</code></td> <td> <p>logical. Whether to remove end portions or fill them with NA.</p> </td></tr> <tr valign="top"><td><code>maxgap</code></td> <td> <p>Runs of more than <code>maxgap</code> <code>NA</code>s are retained, other <code>NA</code>s are removed and the last occurrence in the resulting series prior to each time point in <code>xout</code> is used as that time point's output value.</p> </td></tr> </table> <h3>Details</h3> <p>Interpolate with seasonal Kalman filter, using <code><a href="../../stats/html/StructTS.html">StructTS</a></code>, followed by <code><a href="../../stats/html/tsSmooth.html">tsSmooth</a></code>. The input object should be a regular time series and have a frequency. It is assumed the cycle length is 1.</p> <h3>See Also</h3> <p><code><a href="../../stats/html/StructTS.html">StructTS</a></code>, <code><a href="../../stats/html/tsSmooth.html">tsSmooth</a></code>, <code><a href="na.approx.html">na.approx</a></code></p> <h3>Examples</h3> <pre> z <- zooreg(rep(10 * seq(8), each = 4) + rep(c(3, 1, 2, 4), times = 8), start = as.yearqtr(2000), freq = 4) z[25] <- NA zout <- na.StructTS(z) plot(cbind(z, zout), screen = 1, col = 1:2, type = c("l", "p"), pch = 20) </pre> <hr /><div style="text-align: center;">[Package <em>zoo</em> version 1.8-11 <a href="00Index.html">Index</a>]</div> </body></html>