get_places {CDCPLACES}R Documentation

Obtain data from the CDC PLACES APIs.

Description

Use this function to access CDC PLACES API data. Measures are sourced from the Behavioral Risk Factor Surveillance System and the American Community Survey ACS.

Usage

get_places(
  geography = "county",
  state = NULL,
  measure = NULL,
  county = NULL,
  release = "2023",
  geometry = FALSE
)

Arguments

geography

The level of desired geography. Currently supports 'county', 'census', and 'zcta'.

state

Specify the state of the desired data using the two letter abbreviation. Supports multiple states if desired.

measure

Specify the measures of the data pull. Supports multiple states if desired. For a full list of available measures, see the function 'get_dictionary'.

county

Specify the county of the desired data using the full name of the county, with a capital letter.

release

Specify the year of release for the PLACES data set. Currently supports years 2020-2023.

geometry

if FALSE (the default), return a regular data frame of PLACES data. If TRUE, uses the tigris package to return an sf data frame with simple feature geometry in the 'geometry' column.

Value

A tibble that contains observations for each measure (age-adjusted and unadjusted prevalence for counties) and geographic level.

Examples

get_places(geography = "county", state = "MI", measure = "SLEEP", release = "2023")
get_places(geography = "county", state = c("MI", "OH"),
measure = c("SLEEP", "ACCESS2"), release = "2023")


[Package CDCPLACES version 1.1.6 Index]