R/date2day.R

Defines functions date2day

Documented in date2day

date2day <- function(dates, start=NULL, tz="", ...)
{
  dates <- as.POSIXlt(dates, tz=tz, ...)
  if (is.null(start))
    start <- min(dates)
  else
    start <- as.POSIXlt(start, tz=tz, ...)
  out <- as.numeric(difftime(dates, start, units="days"))
  return(out)
}

Try the ETAS package in your browser

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

ETAS documentation built on May 29, 2024, 3:32 a.m.