Re: [R] out.format for chron

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Thu 19 Oct 2006 - 14:35:28 GMT

As discussed the Help Desk article in R News 4/1, the 2 vs 4 year length is controlled by the chron.year.abb option, e.g.

   options(chron.year.abb = FALSE)
   chron(20)

however, as also discussed there its not really recommended that you use this option so try this instead:

   ddmmyyyy <- function( x )
     with( month.day.year( x ), sprintf( "%02.f-%02.f-%04.f", day, month, year) )

   chron( 20, out.format = ddmmyyyy )

On 10/19/06, Denis Chabot <chabotd@globetrotter.net> wrote:
> Dear R users,
>
> Do you know of a way to precise an out.format for a chron object that
> would use numbers for months and yet 4 digits for the year?
>
> I have tried out.format=c("d-m-year") (note the m instead of either
> mon or month) but got 27-Feb-1992.
>
> Also, the help for chron tells us how to define an out.format when we
> create a chron object, but how can you change the out.format of an
> existing chron object?
>
> Thanks in advance,
>
> Denis
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri Oct 20 11:20:52 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 20 Oct 2006 - 02:30:11 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.