chron yy/mm/dd
Kurt Hornik
Kurt.Hornik@ci.tuwien.ac.at
Fri, 10 Dec 1999 10:29:39 +0100 (CET)
>>>>> 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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._