Skip to contents

CDCAtlas is an R package for retrieving selected public health surveillance data from the CDC’s AtlasPlus platform.

Lifecycle: experimentalLicense: MIT

What is the CDC Atlas database?

AtlasPlus is an interactive CDC data tool that provides access to reported data on HIV, sexually transmitted infections, tuberculosis, viral hepatitis, and selected social determinants of health. It allows users to explore these data through maps, charts, tables, and downloadable reports.

This package provides a programmatic interface to selected AtlasPlus data so that researchers can query, cache, and analyze results directly in R rather than downloading files from the web interface and cleaning them up by hand.



NCHHSTP AtlasPlus: CDC's interactive tool for HIV, viral hepatitis, STD, TB and social determinants of health data



What the package does

CDCAtlas provides a polite, cache-aware R client for selected CDC AtlasPlus endpoints.

AtlasPlus is not a stable, public API, and CDC can change it without notice. This package aims for safe and respectful usage:

  • identifies itself with a custom User-Agent
  • applies rate limiting (at most 5 requests a second)
  • caches responses on disk to reduce server traffic
  • passes on CDC’s own error message when a request fails

It also estimates counts below the county level. CDC publishes many counts only by county, and suppresses small ones. CDCAtlas can:

These are modelled estimates, not CDC data. See Extrapolation to tracts and About CDC AtlasPlus data.

Installation

You can install the development version of CDCAtlas from GitHub with:

# install.packages("remotes")
remotes::install_github("VagishHemmige/CDCAtlas")

Census tract and block group estimates (extrapolate_from_county()) also need the tidycensus package (version 1.8.0 or later) and a Census API key.

Example

State-level gonorrhea cases and rates for 2022:

library(CDCAtlas)

gonorrhea_state <- get_atlas(
  disease = "gonorrhea",
  geography = "state",
  year = 2022
)

See the Getting started article for more.

Citing AtlasPlus

Data downloaded with CDCAtlas come from CDC. CDC’s suggested citation for AtlasPlus is:

Centers for Disease Control and Prevention. NCHHSTP AtlasPlus. https://www.cdc.gov/nchhstp/about/atlasplus.html. Accessed [date].

Use the date you downloaded the data.