Given a data frame:
'data.frame': 2122 obs. of 2 variables:
$ hour : POSIXlt, format: "2015-01-01 00:00:00" "2015-01-01 01:00:00" ...
$ z : int 756 693 675 369 224 487 595 705 573 713 ...
where hour
is incremented by one hour, how do I create a time series?
I want a single series, 24 records per day.
I know I must be missing something trivial.
I tried as.ts(f$z, start=c(hd$hour[1],1), end=c(tail(f$hour,1),1)))
. Nope.
Thanks.
PS. The next step would be to aggregate the series into into a daily one...
hd$hour[1]
? you mean 'f'? – Soheil