EVOLUTION-MANAGER
Edit File: lag.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: Lag a Time Series</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 lag {stats}"><tr><td>lag {stats}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Lag a Time Series</h2> <h3>Description</h3> <p>Compute a lagged version of a time series, shifting the time base back by a given number of observations. </p> <p><code>lag</code> is a generic function; this page documents its default method. </p> <h3>Usage</h3> <pre> lag(x, ...) ## Default S3 method: lag(x, k = 1, ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>A vector or matrix or univariate or multivariate time series</p> </td></tr> <tr valign="top"><td><code>k</code></td> <td> <p>The number of lags (in units of observations).</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>further arguments to be passed to or from methods.</p> </td></tr> </table> <h3>Details</h3> <p>Vector or matrix arguments <code>x</code> are given a <code>tsp</code> attribute <em>via</em> <code><a href="tsp.html">hasTsp</a></code>. </p> <h3>Value</h3> <p>A time series object with the same class as <code>x</code>. </p> <h3>Note</h3> <p>Note the sign of <code>k</code>: a series lagged by a positive <code>k</code> starts <em>earlier</em>. </p> <h3>References</h3> <p>Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) <em>The New S Language</em>. Wadsworth & Brooks/Cole. </p> <h3>See Also</h3> <p><code><a href="../../base/html/diff.html">diff</a></code>, <code><a href="time.html">deltat</a></code> </p> <h3>Examples</h3> <pre> lag(ldeaths, 12) # starts one year earlier </pre> <hr /><div style="text-align: center;">[Package <em>stats</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>