Skip to contents

CDCAtlas provides R functions for retrieving public health surveillance data from CDC AtlasPlus. This vignette introduces installation, basic queries, and data handling.

Installation

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

Example: State-level chlamydia data


library(CDCAtlas)
df <- get_atlas(
  disease   = "chlamydia",
  geography = "state",
  year      = 2022
)

head(df)
#>   indicator year  geography    data_status        race_ethnicity        sex
#> 1 Chlamydia 2022    Alabama Not Suppressed All races/ethnicities Both sexes
#> 2 Chlamydia 2022     Alaska Not Suppressed All races/ethnicities Both sexes
#> 3 Chlamydia 2022    Arizona Not Suppressed All races/ethnicities Both sexes
#> 4 Chlamydia 2022   Arkansas Not Suppressed All races/ethnicities Both sexes
#> 5 Chlamydia 2022 California Not Suppressed All races/ethnicities Both sexes
#> 6 Chlamydia 2022   Colorado Not Suppressed All races/ethnicities Both sexes
#>              age                transmission rate100000  cases population
#> 1 All age groups All transmission categories      612.1  31060    5074296
#> 2 All age groups All transmission categories      727.7   5338     733583
#> 3 All age groups All transmission categories      554.4  40796    7359197
#> 4 All age groups All transmission categories      588.3  17918    3045637
#> 5 All age groups All transmission categories      493.6 192647   39029342
#> 6 All age groups All transmission categories      456.3  26646    5839926
#>   lowerci_rate upperci_rate rse lowerci_cases upperci_cases fips
#> 1           NA           NA  NA            NA            NA   01
#> 2           NA           NA  NA            NA            NA   02
#> 3           NA           NA  NA            NA            NA   04
#> 4           NA           NA  NA            NA            NA   05
#> 5           NA           NA  NA            NA            NA   06
#> 6           NA           NA  NA            NA            NA   08

Simple visualization

library(ggplot2)

ggplot(df, aes(x = geography, y = rate100000)) +
  geom_col() +
  coord_flip() +
  labs(
    title = "Chlamydia Rate by State (2022)",
    x = "State",
    y = "Rate per 100,000"
  )
#> Warning: Removed 1 row containing missing values or values outside the scale range
#> (`geom_col()`).

Next steps

  • Try different diseases or geographies
  • See ?get_atlas for full argument documentation
  • More vignettes coming soon!