EVOLUTION-MANAGER
Edit File: na.fill.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.fill {zoo}"><tr><td>na.fill {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 or specified positions. </p> <h3>Usage</h3> <pre> na.fill(object, fill, ...) ## S3 method for class 'ts' na.fill(object, fill, ix, ...) ## S3 method for class 'zoo' na.fill(object, fill, ix, ...) ## Default S3 method: na.fill(object, fill, ix, ...) na.fill0(object, fill, ix = !is.na(object)) </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>fill</code></td> <td> <p>a three component list or a vector that is coerced to a list. Shorter objects are recycled. The three components represent the fill value to the left of the data, within the interior of the data and to the right of the data, respectively. The value of any component may be the keyword <code>"extend"</code> to indicate repetition of the leftmost or rightmost non-NA value or linear interpolation in the interior. <code>NULL</code> means that items are dropped rather than filled.</p> </td></tr> <tr valign="top"><td><code>ix</code></td> <td> <p>logical. Should be the same length as the number of time points. Indicates which time points not to fill. This defaults to the non-NA values.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments passed to methods.</p> </td></tr> </table> <h3>Details</h3> <p><code>na.fill</code> is a generic function for filling <code>NA</code> or indicated values. It currently has methods for the time series classes <code>"zoo"</code> and <code>"ts"</code> and a default method based on the <code>"zoo"</code> method. </p> <p>Furthermore, <code>na.fill0</code> works with plain vectors and <code>"Date"</code> objects. It also works with <code>"zoo"</code> objects provided that no <code>fill</code> component is <code>NULL</code>. </p> <h3>See Also</h3> <p><code><a href="na.approx.html">na.approx</a></code></p> <h3>Examples</h3> <pre> z <- zoo(c(NA, 2, NA, 1, 4, 5, 2, NA)) na.fill(z, "extend") na.fill(z, c("extend", NA)) na.fill(z, -(1:3)) na.fill(z, list(NA, NULL, NA)) </pre> <hr /><div style="text-align: center;">[Package <em>zoo</em> version 1.8-11 <a href="00Index.html">Index</a>]</div> </body></html>