Skip to contents

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

Usage

cvd_indicator_data(indicator_id = 1, time_period_id = 1, area_id = 1)

Arguments

indicator_id

integer - indicator for which to return data (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 the indicator in the area and a national comparison

Details

CVD Prevent API documentation: Indicator data

Examples

# Look at 'AF: treatment with anticoagulants' (indicator ID 7) in time
# period 17 for  'Leicester Central PCN' (area_id 701) focussed on metrics
# by gender:
cvd_indicator_data(time_period_id = 17, indicator_id = 7, area_id = 701) |>
  dplyr::filter(MetricCategoryTypeName == 'Sex') |>
  dplyr::select(MetricID, MetricCategoryName, AreaData.AreaName,
  AreaData.Value, NationalData.AreaName, NationalData.Value)
#> # A tibble: 3 × 6
#>   MetricID MetricCategoryName AreaData.AreaName     AreaData.Value
#>      <int> <chr>              <chr>                          <dbl>
#> 1      150 Persons            Leicester Central PCN           95.4
#> 2      125 Female             Leicester Central PCN           94.7
#> 3      124 Male               Leicester Central PCN           96.0
#> # ℹ 2 more variables: NationalData.AreaName <chr>, NationalData.Value <dbl>