Learn R Programming

gtfstools (version 2.0.1)

dates_to_periods: Collapse days into periods of consecutive days

Description

Collapse days into periods of consecutive days

Usage

dates_to_periods(dates)

Value

A data.table with the columns start_date, end_date and n_days, with one row per period of consecutive days.

Arguments

dates

A sorted Date vector of unique days.