R/as.Date1970.R

Defines functions as.Date1970

Documented in as.Date1970

as.Date1970 <- function(x, ...){
#
  if(is.numeric(x)){
      dots <- list(...)
      dots$x <- x
      if(!('origin' %in% names(dots))){
          o1970 <- as.Date('1970-01-01', '%Y-%m-%d')
          dots$origin <- o1970
      }
      xD <- do.call(as.Date, dots)
      return(xD)
  }
  as.Date(x, ...)
}

Try the Ecfun package in your browser

Any scripts or data that you put into this service are public.

Ecfun documentation built on Oct. 10, 2022, 1:06 a.m.