Skip to content

Hourly Time Series

3 messages · Harshal D Dedhia, Gabor Grothendieck, Jeffrey J. Hallman

4 days later
#
Using zoo would allow you to retain the date/time portion.  In ts you would
have to represent them as numbers; however, as you can easily switch
from zoo to ts you probably want to use zoo in the first instance:

library(zoo)
library(chron)
Lines <- "DateID        HourID        Metrics
20060920    0                1
20060920    1                2"
z <- read.zoo(textConnection(Lines), header = TRUE, format = "%Y%m%d")
metrics <- aggregate(z[,2], chron(unclass(time(z))) + unclass(z[,1])/24, sum)
metrics
as.ts(metrics)
On 12/11/06, Harshal D Dedhia <harshal at yahoo-inc.com> wrote:
#
The 'fame' package I submitted to CRAN can handle hourly, minutely, and
secondly series.  The first submission I made last night did not build
correctly on a Linux machine without the FAME libraries, but the one I put up
this morning has fixed that. It should be available soon, unless I missed
another problem (entirely possible).