add_regions | R Documentation |
Takes a data frame with a state variable and uses those states to categorize US census regions
add_regions(dataset, state_var, new_name = census_region)
dataset |
The name of the data frame for the function to modify, usually piped into your main data frame. |
state_var |
NO DEFAULT; The state variable on which census regions will be based. Can be state name or state abbreviations |
new_name |
DEFAULT = census_region; the name for your new census region variable, as an object not a "string" |
responses <- tibble::tibble(
state = c(
'Virginia',
'UTAH',
'New York',
'alaska',
'Washington DC'
)
)
add_regions(responses, state_var = state)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.