From Kurt.Hornik@ci.tuwien.ac.at  Fri Dec 10 09:29:39 1999
From: Kurt.Hornik@ci.tuwien.ac.at (Kurt Hornik)
Date: Fri, 10 Dec 1999 10:29:39 +0100 (CET)
Subject: chron yy/mm/dd
In-Reply-To: <384D797B.9CF3A84F@bank-banque-canada.ca>
References: <384D797B.9CF3A84F@bank-banque-canada.ca>
Message-ID: <14416.51203.278401.361896@fangorn.ci.tuwien.ac.at>

>>>>> Paul Gilbert writes:

> I'm not too familiar with chron, but I don't think it should drop the
> month and day in the second example following example:

>> chron(20000, format="y/m/d")
> [1] 124/10/04
>> chron(20000, format="yy/m/d")
> [1] 2024

Paul:

This simply is not supported.  Look at parse.format() in the chron pkg.
What it does is

* if format has 5 chars, parse as "a/b/c"

* if format has 3 chars, parse as "abc"

* else parse as "a b c" (and do not abbreviate month names if "month" is
given.

In you example, we get

R> unlist(parse.format("yy/m/d"))
    abb     sep periods mon.abb 
"FALSE"     " "     "y"  "TRUE" 

and hence we only get the years.

Hope this helps.

Best,
-k
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


chron yy/mm/dd
Kurt Hornik