[R] as.Date

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Feb 8 18:45:09 CET 2011


On Tue, 8 Feb 2011, Philipp Pagel wrote:

>> I have a strange behavior of the as.Date() function. For example:
>> as.Date(36525, origin="1900-01-01'")
>>
>> I would expect to get 2000-01-01. But R gives me
>
> That's almost exactly what I get with R 2.11.1, LINUX (minus the
> one-day differnce which is probably correct, too lazy to count leap
> years...):
>
>> as.Date(36525, origin="1900-01-01'")
> [1] "2000-01-02"
>
> At first I thought the excess single quote maight be causingyour
> problem, but it doesn't for me.
>
> Maybe you need to upgrade R? Possibly it's an already fixed issue?

Or perhaps it is a problem with the OS services on the unstated R 
platform used (this will use strptime from the OS).  The single quote 
is definitely wrong, however.

>
> cu
> 	Philipp
>
>
> -- 
> Dr. Philipp Pagel
> Lehrstuhl für Genomorientierte Bioinformatik
> Technische Universität München
> Wissenschaftszentrum Weihenstephan
> Maximus-von-Imhof-Forum 3
> 85354 Freising, Germany
> http://webclu.bio.wzw.tum.de/~pagel/
>
> ______________________________________________
> R-help at r-project.org 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.
>

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