R set default origin for as.Date
Is there a way to set default origin for as.Date? I did this function to workaround: as.date=function(x, origin='1970-01-01') as.Date(x, origin=origin) For example: as.Date(0) Error in as.Date.numeric(0) : 'origin' deve ser especificado as.date(0) [1] "1970-01-01" The zoo package adds a default origin: library(zoo) as.Date(0) ## [1] "1970-01-01" There is an elegant and simple solution, like zoo, but allows for some tweaking if you need it: require(anytime) The base is simply: anytime(0) which returns for me in eastern standard time: [1] "1969-12-31 19:00:00 EST" If you want to be able to force