Skip to contents

Convert a set of timepoints to dates

Usage

time_to_date(
  timepoints,
  unit = attr(timepoints, "unit"),
  day_zero = getOption("day_zero", "2019-12-29")
)

Arguments

timepoints

a set of numeric time points

unit

the period / unit of the time points, which will be extracted from timepoints if possible

day_zero

the zero day of the time series, will be extracted from timepoints if possible

Value

a vector of dates

Examples

# DEPRECATED
# times = date_to_time(as.Date("2019-12-29")+0:100, "1 week")
# dates = time_to_date(times)