Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

as.Date.numeric requires origin in Linux, not Windows. Fix?

Tags:

r

as.Date(10000) works fine in Windows, but on a Linux distribution it errors: 'origin' must be supplied. Somehow the Windows installation has a default origin? I'm trying to build/check a package on Linux that was originally developed on a Windows machine. This package omits the origin parameter all over the place. Is there a quick fix? Perhaps an addition to Rprofile.site?

like image 554
SFun28 Avatar asked May 13 '26 22:05

SFun28


2 Answers

Load the zoo package. It provides a version of as.Date.numeric with a default origin, e.g.

library(zoo)
as.Date(0)
like image 97
G. Grothendieck Avatar answered May 15 '26 18:05

G. Grothendieck


You must be running an older version of R on your windows machine. as.Date(10000) does not work for me on Windows XP running R-2.13.1.

like image 23
Joshua Ulrich Avatar answered May 15 '26 18:05

Joshua Ulrich



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!