[R] lag operator on a zoo object - code sharing

2014-10-15 Thread jpm miao
Hi, I could not find a nice lag operator on zoo object. Perhaps there is, but I just couldn't find it. Basically I want the operator to return the lagged zoo object (with one or more variables ) with the original date. For example, if I write lag(x, -3), then I got the lagged series, but the

Re: [R] lag operator on a zoo object - code sharing

2014-10-15 Thread Achim Zeileis
On Wed, 15 Oct 2014, jpm miao wrote: Hi, I could not find a nice lag operator on zoo object. Perhaps there is, but I just couldn't find it. See ?lag.zoo. Basically I want the operator to return the lagged zoo object (with one or more variables ) with the original date. For example, if I

Re: [R] lag operator on a zoo object - code sharing

2014-10-15 Thread Pascal Oettli
Hi, You probably missed the na.pad argument of the lag function (for zoo objects). ?zoo:::lag.zoo Regards, Pascal On Wed, Oct 15, 2014 at 6:00 PM, jpm miao miao...@gmail.com wrote: Hi, I could not find a nice lag operator on zoo object. Perhaps there is, but I just couldn't find it.