Skip to contents

Returns same data as cvd_indicator_list() but adds a 'MetricList' array for each indicator, containing details of the relevant metrics. Only returns indicators for which data exists in selected time period, and on selected system level.

Usage

cvd_indicator_metric_list(time_period_id = 1, system_level_id = 1)

Arguments

time_period_id

integer - time period to return data for (compulsory)

system_level_id

integer - system level to return data for (compulsory)

Value

Tibble of details for indicators and associated metrics

Details

CVD Prevent API documentation: Indicator metric list

Examples

# List metrics for the prevalence of atrial fibrillation (indicator ID 1),
# focussing on just those metrics for the 40-59 years age group:
cvd_indicator_metric_list(time_period_id = 17, system_level_id = 1) |>
  dplyr::filter(IndicatorID == 1, MetricCategoryName == '40-59') |>
  dplyr::count(IndicatorID, IndicatorShortName, MetricID, MetricCategoryName, CategoryAttribute) |>
  dplyr::select(-n)
#> # A tibble: 3 × 5
#>   IndicatorID IndicatorShortName MetricID MetricCategoryName CategoryAttribute
#>         <int> <chr>                 <int> <chr>              <chr>            
#> 1           1 AF: prevalence          173 40-59              Female           
#> 2           1 AF: prevalence          175 40-59              Male             
#> 3           1 AF: prevalence          187 40-59              Persons