Skip to content
Prev 5683 / 15274 Next

Creating regularly spaced time series from irregular one

You probably want to ask the author of the its package directly about that.

Note that as.zoo has an its method and as.its has a zoo method and
they will allow you to convert back and forth between its and zoo so
you can effectively use the functionality of both packages:

# converting back and forth
library(zoo)
library(its)
ii <- its(1:3, seq(Sys.time(), length = 3, by = "day"))
z <- as.zoo(ii)
ii2 <- as.its(z)

In zoo, see the discussion of the intraday.discretize function which
is defined in the following vignette:

library(zoo)
vignette("zoo-quickref")

# also see
vignette("zoo")
vignette("zoo-faq")

The discretizing discussion mentioned may apply in concept if not
literally to its as well.

Also note that zoo has an its method for the lattice xyplot function.

The xts package is defined as a layer on top of zoo and shares some
functions and methods with zoo and is particularly geared to finance
along with the quantmod package by the same author so see them too.
Also there is a list of R packages in the zoo-faq vignette mentioned
above that may be of interest.

On Mon, Feb 22, 2010 at 3:52 PM, Ivan Kalafatic
<ivan.kalafatic at gmail.com> wrote: