powered by
Collapse days into periods of consecutive days
dates_to_periods(dates)
A data.table with the columns start_date, end_date and n_days, with one row per period of consecutive days.
data.table
start_date
end_date
n_days
A sorted Date vector of unique days.
Date