Skip to contents

Returns all available time periods

Usage

cvd_time_period_list(indicator_type_id)

Arguments

indicator_type_id

integer - Indicator type ID, e.g. standard or outcome indicator type. If passed will show time periods containing data of the given type (optional)

Value

Tibble of time period details

Details

CVD Prevent API documentation: Time period

Examples

# NB, the following examples are not tested because they take longer than
# expected to return the results

# get a tibble of all periods
cvd_time_periods <- cvd_time_period_list()

# filter for the latest four periods
cvd_time_period_list() |>
  dplyr::filter(IndicatorTypeName == 'Standard') |>
  dplyr::slice_max(order_by = TimePeriodID, n = 4) |>
  dplyr::select(TimePeriodID, TimePeriodName)
#> # A tibble: 4 × 2
#>   TimePeriodID TimePeriodName   
#>          <int> <chr>            
#> 1           17 To March 2024    
#> 2           17 To March 2024    
#> 3           15 To December 2023 
#> 4           10 To September 2023