list_StratificationTypes: List stratification values

View source: R/list_StratificationTypes.R

list_StratificationTypesR Documentation

List stratification values

Description

Some measures on the Tracking Network have a set of "Advanced Options" that allow the user to access data stratified by variables other than geography or temporal period. For instance, data on asthma hospitalizations can be broken down further by age and/or gender. This function allows the user to list available "Advanced Options" stratification values for specified measures and geographic types. For instance, in the case of the asthma hospitalization data, it would be possible to view the potential gender (e.g., Male, Female), and age (e.g., 0–4 years, >=65 years) values that are available.

The user should not need this function to retrieve data from the Tracking Network Data API because the get_data() function calls it internally. It can, however, be used as a reference to view available stratification values or to identify specific stratification items to request.

Usage

list_StratificationTypes(measure, geo_type = NA, smoothing = 0, token = NULL)

Arguments

measure

Specifies the measure of interest as an ID or name. IDs should be unquoted; name entries should be quoted strings.

geo_type

An optional argument in which you can specify a geographic type as a quoted string (e.g., "State", "County") or a geographic type ID as an unquoted numeric value (e.g., 1, 2). The "geographicType" and "geographicTypeId" columns in the list_geography_types() output contain a list of potential geo_type entries associated with each measure.

smoothing

Specifies whether to return stratification values for geographically smoothed versions of a measure (1) or not (0). The default value is 0 because smoothing is not available for most measures.

token

An optional argument to submit a Tracking API token acquired from trackingsupport(AT)cdc.gov as a quoted string. It is recommended that you save your token using the tracking_api_token() function so that you don't need to enter your token when you run this function. It will be automatically pulled from you .Renviron file.

Value

This function returns a list with each element containing a data frame corresponding to all combinations of specified measures and geographic types. Within each row of the data frame is a nested data frame containing the stratification values. If the specified measure and associated geographic type do not have any "Advanced Options" stratification types, the returned list element will be empty.

Examples

## Not run: 


list_StratificationTypes(measure=370)

list_StratificationTypes(measure=c(370,423,707))
 
list_StratificationTypes(measure=c("Number of summertime (May-Sep) heat-related deaths, by year",
  "Number of extreme heat days","Number of months of mild drought or worse per year"))
  
list_StratificationTypes(measure=c("Number of summertime (May-Sep) heat-related deaths, by year",

## End(Not run)

CDCgov/EPHTrackR documentation built on June 6, 2024, 9:21 a.m.