[R] Regular time series with irregular start and end dates
Wesley Roberts
WRoberts at csir.co.za
Wed Oct 27 16:01:47 CEST 2010
Dear R users,
I have a quick question regarding creating an index for a zoo object. I am using R 2.12 on winxp.
I have read through the R archives searching for information on dates and time series analysis and nothing seems to cover my question.
I am extracting data from a time series of remote sensing data. The frequency of the data is 16 days which means I cant use ts (ts likes months single days etc) and have thus been trying to replicate the following dates using ISOdatetime.
09/13/2005 09/29/2005 10/15/2005 10/31/2005 11/16/2005 12/02/2005 12/18/2005
So far, the only method I have found to be successful is the following
a<-ISOdatetime(2005, 9, c(13,29), 0, 0, 0)
b<-ISOdatetime(2005, 10, c(15,31), 0, 0, 0)
c<-ISOdatetime(2005, 11, c(16), 0, 0, 0)
d<-ISOdatetime(2005, 12, c(2,18), 0, 0, 0)
e<-c(a,b,c,d)
> sort(e)
[1] "2005-09-13 SAST" "2005-09-29 SAST" "2005-10-15 SAST" "2005-10-31 SAST"
[5] "2005-11-16 SAST" "2005-12-02 SAST" "2005-12-18 SAST"
This is obviously highly convoluted and is not an appropriate solution.
I would appreciate some advice as to how I would go about creating an index that starts at date 2005-09-13 and creates the next date 16 days ahead till the finishing date 2006-10-15. Also, given the nature of my time series would I be able to use ts instead of zoo?
Many thanks for your input,
Wesley
--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean. MailScanner thanks Transtec Computers for their support.
More information about the R-help
mailing list