Skip to contents

Returns all metric data for a specified metric. Data will include values for both selected area and organisation at National Level (usually England).

Usage

cvd_indicator_metric_data(metric_id = 7, time_period_id = 1, area_id = 2)

Arguments

metric_id

integer - metric for which to return data for (compulsory)

time_period_id

integer - time period for which to return data for (compulsory)

area_id

integer - area for which to return data for (compulsory)

Value

Tibble of details for metric performance in the area and time period

Details

CVD Prevent API documentation: Indicator metric data

Examples

# Retrieve metric data for AF: treatment with anticoagulants for 'Alliance
# PCN' (area ID 399) in time period 1 for metric 126 (breakdown by age group:
# males aged 40-59):
cvd_indicator_metric_data(metric_id = 126, time_period_id = 1, area_id = 399) |>
  dplyr::select(IndicatorShortName, CategoryAttribute, MetricCategoryName,
  AreaData.Value, NationalData.Value)
#> # A tibble: 1 × 5
#>   IndicatorShortName         CategoryAttribute MetricCategoryName AreaData.Value
#>   <chr>                      <chr>             <chr>              <lgl>         
#> 1 AF: treatment with antico… Male              40-59              NA            
#> # ℹ 1 more variable: NationalData.Value <dbl>