Re: chron yy/mm/dd

About this list Date view Thread view Subject view Author view Other groups

Subject: Re: chron yy/mm/dd
From: Kurt Hornik (Kurt.Hornik@ci.tuwien.ac.at)
Date: Fri 10 Dec 1999 - 19:29:39 EST


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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Tue 04 Jan 2000 - 14:16:11 EST