[R] Reformatting dates using chron
andy at arcriswell.com
Thu Jan 11 19:07:37 CET 2001
I am trying to generate a sequence of dates using library(chron). Using the following code, I got most of what I want,
dts <- seq.dates("01/02/1998", "01/10/2001", by="day")
dts <- dts[!is.weekend(dts)]
a sequence of weekdays only (no weekend dates), with first observation appearing as 01/02/98 and the last 01/10/01. But I would like it to appear as 1998/01/02 to 2001/01/10.
Is there some way to change the order of the output and allow "year" to appear with four digits and slash signs between year, month and day?
(I am using R 1.2.0 on a Windows 2000 platform.)
Thanks (in advance),
Professor of Finance
Graduate School, Bangkok University
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the R-help