[R-SIG-Finance] Re[R-sig-finance] lative Date Question
CHD850
chd850 at gmail.com
Wed Mar 18 21:28:04 CET 2009
Hi Jeff,
Did you notice the difference in Feb 2000, as in bold? Should we expect to
see that from using lastof() ? In the function the year was divided by 400.
I wonder if that has something to do with this.
Thanks,
Stanley
Jeff Ryan wrote:
>
> using xts:
>
>> library(xts)
>
>> timeBasedSeq('2000-02/2001-01',"Date")-1
> [1] "2000-01-31" "2000-02-29" "2000-03-31" "2000-04-30" "2000-05-31"
> [6] "2000-06-30" "2000-07-31" "2000-08-31" "2000-09-30" "2000-10-31"
> [11] "2000-11-30" "2000-12-31"
>
>> Sys.setenv(TZ='GMT') # watch for TZ issues...
>> as.Date(lastof(2000,1:12))
> [1] "2000-01-31" "2000-02-28" "2000-03-31" "2000-04-30" "2000-05-31"
> [6] "2000-06-30" "2000-07-31" "2000-08-31" "2000-09-30" "2000-10-31"
> [11] "2000-11-30" "2000-12-31"
>
>
>
> HTH,
> Jeff
>
--
View this message in context: http://www.nabble.com/Relative-Date-Question-tp19196979p22587804.html
Sent from the Rmetrics mailing list archive at Nabble.com.
More information about the R-SIG-Finance
mailing list