Period Mid-Dates and Mid-Times
mid_dates_times.Rd
Compute a vector giving the mid-points of a vector of temporal periods,
defined by start dates and one of either a vector of end dates or a vector
of period lengths in days (see num_days
). You can either
return a date, with mid_dates
, or a date-time, with mid_times
.
In addition to the type of return value (date vs time), the former rounds
down to the nearest date whereas the latter is accurate to the nearest hour
and so can account for uneven
Arguments
- start_date
Vector of period starting dates
- end_date
Vector of period ending dates. If missing then
period_length
is used to define the ends of the periods.- period_length
Vector of integers giving the period length in days. If missing then it is calculated using
num_days
.