View source: R/list_StratificationLevels.R
list_StratificationLevels | R Documentation |
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 levels for specified measures and geographic types. For instance, in the case of the asthma hospitalization data, it would be possible to view the full range of stratification levels available, including gender, age, and both gender and age combined.
Because "Advanced Options" may only be available at a particular geographic type (e.g., an age-breakdown of asthma hospitalizations is only available at the state-level), results showing available stratification levels always include the geographic type. Therefore, this function can be used to identify geographic types and stratification levels of interest.
list_StratificationLevels(measure, geo_type = NA, smoothing = 0, token = NULL)
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 levels for geographically smoothed versions of a measure (1) or not (0). The default value is 0 because smoothing is not available for most measures. Requesting smoothed data when it is not available will produce an error. |
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. |
The output of this function is a list with data frame elements for each measure submitted. The data frames contain a row for each stratification level.
## Not run:
list_StratificationLevels(measure=370)
list_StratificationLevels(measure=c(370,423,707))
list_StratificationLevels(measure=c("Number of summertime (May-Sep) heat-related deaths, by year",
"Number of extreme heat days","Number of months of drought per year"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.