Given the date, I can access the corresponding element in the zoo vector. For instance:
z[as.POSIXct(1213708500, origin="1970-01-01")]
it returns
2008-06-17 14:15:00 -8.28123
I would like to get a vector of 30 consecutive elements (ending with the element above).
How can I do this (efficiently) without knowing the timestamp of the start element?
I know that I can do this using the window function, but this requires a start time and an end time.
source share