Skip to contents

Create interval, period and time length columns from a start and end date

Usage

make_interval(df, start, end = lubridate::today())

Arguments

df

A <data.frame> or <tibble>

start

<date> Start date column

end

<date> End date column

Value

<data.frame> or <tibble>

Examples

dplyr::tibble(date = lubridate::today() - 366) |>
  make_interval(start = date)
#> # A tibble: 1 × 4
#>   date       interval                       period            timelength_days
#>   <date>     <Interval>                     <Period>                    <dbl>
#> 1 2023-12-25 2023-12-25 UTC--2024-12-25 UTC 1y 0m 0d 0H 0M 0S             366