Skip to contents

Creates a date range string from vector of dates with count and interval. Format is: "YYYY-MM-DD to YYYY-MM-DD (n = ..., ... days (to nearest day))"

Usage

summarise_date_range(dates)

Arguments

dates

Vector of dates

Value

Character string with date range, sample count, and interval in days

Examples

summarise_date_range(as.Date(c("2020-01-15", "2021-06-01", "2022-03-10")))
#> 2020-01-15 to 2022-03-10 (n=3, 785 days (to nearest day))
summarise_date_range(as.Date(c("2021-07-01", "2021-07-01")))
#> 2021-07-01 (n=1)