Dear all,
 
I would like point out a potential bug (or at least inconsistency) in the
way the R base package converts numeric numbers to dates. Specifically,
consider the following two calls:
 
> as.Date(0.5, origin="1969-12-31")
[1] "1970-01-01"
> as.Date(0.5, origin="1970-01-01")
[1] "1970-01-01"
 
As you can see, both calls produce the same output on the screen. Curiously,
the output is NOT the same for other consecutive origins:
 
> as.Date(0.5, origin="2009-12-31")
[1] "2009-12-31"
> as.Date(0.5, origin="2010-01-01")
[1] "2010-01-01"
 
Best regards,
Andreas Eckner
 
 
----------------------
> sessionInfo()
R version 2.11.0 (2010-04-22) 
i386-pc-mingw32 
 
locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
States.1252   
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C

[5] LC_TIME=English_United States.1252    
 
attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

        [[alternative HTML version deleted]]

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to