Skip to content
Prev 170090 / 398506 Next

Question about apply()

There is no zoo method for embed.  embed is implicit in
rollapplly so its not normally needed in zoo and rollapply,
lag or diff would normally be used instead.

If you did want to use embed then unzoo data first but
that will lose the time index so add it back in later:

e <- embed(coredata(data),2)
dif <- zoo(e[, 1:4] / e[, 5:8] - 1, time(data)[-1])
cbind(data, dif)
On Wed, Feb 11, 2009 at 7:45 AM, Sergey Goriatchev <sergeyg at gmail.com> wrote: