Suraj
Suraj

Reputation: 36587

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

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?

Upvotes: 2

Views: 470

Answers (2)

G. Grothendieck
G. Grothendieck

Reputation: 270010

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

library(zoo)
as.Date(0)

Upvotes: 8

Joshua Ulrich
Joshua Ulrich

Reputation: 176698

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.

Upvotes: 2

Related Questions