[R] Convert number to Date

Joshua Wiley jwiley.psych at gmail.com
Thu Mar 25 23:41:16 CET 2010


> Kind of off the thread a bit, but when I do:
>
>> as.Date(40182)
>
> I ***do not*** get "2080-01-06".  Instead I get an error:
>
> Error in as.Date.numeric(40182) : 'origin' must be supplied
>
> Am I the only user who gets picked on in this way, or does it
> happen to others as well?  The help on as.Date() clearly specifies
> that "origin" must be supplied.  So how come Anna got the result that
> she did?

I also get that error.  I believe there was a thread a few years back
discussing the merits of including a default origin, but to my
knowledge, it was never implemented, and there is no way to set a
default (e.g., through options()).

> sessionInfo()
R version 2.10.1 (2009-12-14)
i386-pc-mingw32
locale:
<snip>
[5] LC_TIME=English_United States.1252


-- 
Joshua Wiley
Senior in Psychology
University of California, Riverside
http://www.joshuawiley.com/



More information about the R-help mailing list