countyhealthR

An R package for programmatic access to archived County Health Rankings & Roadmaps (CHR&R) data, inspired by the simplicity of the tidycensus package.

CRAN Version CRAN Downloads Contributions Welcome

The current version of countyhealthR includes four functions to interact with CHR&R data:

  1. list_chrr_measures: see all the measures that are available for a selected release year.
  2. get_chrr_measure_data: download data for all geographic areas for a selected measure and release year.
  3. get_chrr_county_data: download data for all measures for a selected geographic area and release year.
  4. get_chrr_measure_metadata: access additional details about a selected measure, such as the measure's position within the UWPHI Model of Health

You can learn more about each function and its arguments by checking out the reference manual.

Install

Install the stable CRAN version

install.packages("countyhealthR")

Install the development version (GitHub)

# install.packages("devtools") # if needed 
# devtools::install_github("countyhealthrankings/countyhealthR")
install.packages("countyhealthR", repos = c('https://countyhealthrankings.r-universe.dev', 'https://cloud.r-project.org'))

Quick Start

library(countyhealthR)

# Example: Load county-level premature death data for the 2024 release
get_chrr_measure_data(
  geography = "county",
  measure = "premature death",
  release_year = 2024
)