[R] Reformatting dates using chron

Andrew Criswell andy at arcriswell.com
Thu Jan 11 19:07:37 CET 2001

Hello All:

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),

Andrew Criswell
Professor of Finance
Graduate School, Bangkok University

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://stat.ethz.ch/pipermail/r-help/attachments/20010112/48332d11/attachment.html

More information about the R-help mailing list