[R] Julian dates

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Jan 28 19:33:14 CET 2004


On Wed, 28 Jan 2004 Ted.Harding at nessie.mcc.ac.uk wrote:

> > origin(dates("01/02/29",out.format="d/m/year"))
> month   day  year 
>     1     1  1970 
> 
> So why does Massimiliano's example behave as though the origin
> were 01/01/1930?

It doesn't.  It behaves as if he wrote "01/02/2029" and he intended
"01/02/1929" (but chron failed to read his mind).  That is an undocumented
`feature' of the auxiliary function year.expand(), whose use is an
undocumented `feature' of convert.dates() (whose use is ..., well it gets
boring).

You will find all date-conversion routines do something like this with 
incompletely specified years.  Read the help on %y in ?strptime.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list