[R] Hourly data with zoo
Gabor Grothendieck
ggrothendieck at gmail.com
Mon Sep 12 18:45:19 CEST 2011
On Mon, Sep 12, 2011 at 11:57 AM, steven mosher <moshersteven at gmail.com> wrote:
> Gabor.. thanks.
>
> zr <- zooreg(rnorm(24), as.chron("2011-01-01"), frequency = 24)
>
> a couple issues: my date data has missing days and missing hours..
> Sorry if I was not clear on
> that.. I input it to a data frame and dates are of the form 20110101
> and hours are in the format
> 0,100,200
>
> The end goal is to create a data structure for around 200 series aligned by time
Try this:
v <- df$data
z <- zoo(v, as.chron(d, format = "%Y%m%d") + h / 2400)
--
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com
More information about the R-help
mailing list