| Title: | Programmatic Access to County Health Rankings & Roadmaps Data |
|---|---|
| Description: | Provides a simple interface to pull County Health Rankings & Roadmaps (CHR&R) county-level health data and metadata directly from 'Zenodo' <doi:10.5281/zenodo.18157681>. Users can retrieve data for CHR&R release years 2010 through 2025. CHR&R data support research and decision-making to promote health equity and policies that help all communities thrive. |
| Authors: | Hannah Olson-Williams [aut, cre] |
| Maintainer: | Hannah Olson-Williams <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.5 |
| Built: | 2026-05-12 09:00:39 UTC |
| Source: | https://github.com/countyhealthrankings/countyhealthr |
Returns County Health Rankings & Roadmaps (CHR&R) measure data for a specified state and (optionally) county and release year. Data are retrieved from the Zenodo repository and include measure values and associated metadata.
get_chrr_county_data( state, county = NULL, release_year = NULL, refresh = FALSE, citation = TRUE, verbose = TRUE )get_chrr_county_data( state, county = NULL, release_year = NULL, refresh = FALSE, citation = TRUE, verbose = TRUE )
state |
|
county |
|
release_year |
|
refresh |
|
citation |
|
verbose |
|
If a county is specified, county-level data are returned. If the
county argument is missing, NA, or "000",
state-level data are returned instead.
A tibble (class tbl_df, tbl, data.frame)
containing CHR&R measure values for the specified geography
and release year.
For county-level requests, the tibble includes one row per measure for the specified county and contains the following columns:
Character. Two-digit state FIPS code.
Character. Three-digit county FIPS code.
Character. Unique CHR&R measure identifier.
Character. Measure name.
Character. Brief measure description.
Numeric. Reported measure value.
Numeric. Lower bound of confidence interval, if available.
Numeric. Upper bound of confidence interval, if available.
Numeric. Measure numerator, if available.
Numeric. Measure denominator, if available.
Character. Years used in calculation of the measure.
Character. Text describing temporal comparison.
Character. Text describing state comparison.
For state-level requests, the structure is identical except that
county_fips is not included.
The returned tibble represents the full set of CHR&R measures available for the specified geography and release year.
# County-level example dane <- get_chrr_county_data("WI", "Dane", 2024) head(dane) # State-level example wi <- get_chrr_county_data("WI", county = NULL, 2024) head(wi)# County-level example dane <- get_chrr_county_data("WI", "Dane", 2024) head(dane) # State-level example wi <- get_chrr_county_data("WI", county = NULL, 2024) head(wi)
Downloads and filters County Health Rankings & Roadmaps (CHR&R) data directly
from the 'Zenodo' archive
(doi:10.5281/zenodo.18157681).
Users provide the measure ID, geography type, and release year as inputs.
The function returns data for the specified measure across the specified geography
for the given release year. It mimics the style and behavior of
tidycensus::get_decennial().
get_chrr_measure_data( geography = c("county", "state", "national"), measure, release_year = NULL, refresh = FALSE, citation = TRUE, verbose = TRUE )get_chrr_measure_data( geography = c("county", "state", "national"), measure, release_year = NULL, refresh = FALSE, citation = TRUE, verbose = TRUE )
geography |
A string specifying the level of geography to return. Options are:
|
measure |
Either:
Use the |
release_year |
|
refresh |
|
citation |
|
verbose |
|
A tibble (class tbl_df, tbl, data.frame)
containing CHR&R data for the specified measure, geography,
and release year.
The tibble contains one row per geographic unit and includes:
Character. Two-digit state FIPS code.
Character. Three-digit county FIPS code. Present only for county-level data.
Numeric. Reported measure value.
Numeric. Measure numerator, if available.
Numeric. Measure denominator, if available.
Numeric. Lower confidence interval bound, if available.
Numeric. Upper confidence interval bound, if available.
The returned tibble represents the full set of observations for the requested measure at the specified geographic level and release year.
# Get county-level data for measure 21 (high school graduation) in 2023 county_data <- get_chrr_measure_data( geography = "county", measure = 21, release_year = 2023) # Get state-level data for "Insufficient Sleep" in 2022 state_data <- get_chrr_measure_data( geography = "state", measure = "insufficient sleep", release_year = 2022) # Get national-level data for "Uninsured" in 2024 nat_data <- get_chrr_measure_data( geography = "national", measure = "uninsured", release_year = 2024)# Get county-level data for measure 21 (high school graduation) in 2023 county_data <- get_chrr_measure_data( geography = "county", measure = 21, release_year = 2023) # Get state-level data for "Insufficient Sleep" in 2022 state_data <- get_chrr_measure_data( geography = "state", measure = "insufficient sleep", release_year = 2022) # Get national-level data for "Uninsured" in 2024 nat_data <- get_chrr_measure_data( geography = "national", measure = "uninsured", release_year = 2024)
Returns structured metadata for a County Health Rankings & Roadmaps (CHR&R) measure for a given release year. The metadata describes the measure's position within the CHR&R Model of Health, which has evolved over time: releases prior to 2025 follow the legacy model, while 2025 and later releases use the new model of health. Metadata is year-specific, reflecting the measure definitions and groupings used in that release.
get_chrr_measure_metadata(measure, release_year = NULL)get_chrr_measure_metadata(measure, release_year = NULL)
measure |
A |
release_year |
A |
A tibble (class tbl_df, tbl, data.frame)
containing one row of metadata for the requested measure.
Columns include:
Numeric. CHR&R release year.
Numeric. Unique identifier for the measure.
Character. Official name of the measure.
Character. Text description of the measure definition.
Character. Data years used in calculating the measure.
Character. Top-level grouping in the CHR&R model.
Character. Category within factor.
Character. Focus area within category.
Numeric. Indicates score orientation:
1 = higher values are worse,
-1 = higher values are better.
Numeric. Recommended number of decimal places for reporting values.
Numeric. Suggested display format code: 0 = rate, 1 = percentage, 2 = dollars, 3 = ratio, other values reserved for internal codes.
Character. Notes about comparability across states.
Character. Notes about comparability across release years.
# Return metadata md <- get_chrr_measure_metadata(21, 2024) md$display_precision md$format_type md$direction md$compare_states_text# Return metadata md <- get_chrr_measure_metadata(21, 2024) md$display_precision md$format_type md$direction md$compare_states_text
Downloads metadata for a release year and returns measure identifiers, names, and descriptions.
list_chrr_measures(release_year = NULL)list_chrr_measures(release_year = NULL)
release_year |
Numeric year corresponding to the year of
CHR&R's annual data release. Defaults to the most recent release
year if |
A tibble (class tbl_df) with one row per measure for the
specified release year and the following columns:
Numeric. Unique identifier for the measure.
Character. Name of the measure.
Character. Brief description of the measure.
measures <- list_chrr_measures(2023) head(measures)measures <- list_chrr_measures(2023) head(measures)