Description Usage Arguments Value Examples
census_seg uses the census api to download race & ethnicity data from a specified 5 year ACS survey from the table "B03002" or the decennial census tables P0040\*\* P0050\*\* for the 2000 and 2010 census respectively. From these tables the racial groups White, Black, American Indian or Alaskan Native, Asian, Native Hawaiian or Pacific Islander, some other race, and two or more Races are considered and treated as mutually exclusive categories for individuals who mark Non-Hispanic. Hispanic individuals are designated as Hispanic no matter what they mark for their Racial identifier and are treated as a mutually exclusive racial group for the purposes of the analysis. Then, segregation measures are calculated on the resulting data.
1 2 3 4 5 6 7 8 9 10 11 | census_seg(
state = NULL,
county = NULL,
metro = NULL,
geography = "tract",
cache_table = FALSE,
year = 2010,
key = NULL,
seg_func = calc_theilsH,
...
)
|
state |
An optional vector of states for which you are requesting data. State names, postal codes, and FIPS codes are accepted. Defaults to NULL. |
county |
The county for which you are requesting data. County names and FIPS codes are accepted. Must be combined with a value supplied to 'state'. Defaults to NULL. |
metro |
The cbsa name or fips code. Pulls all counties within a given CBSA. See cbsa_county_df for more info on county to cbsa mapping. Defaults to NULL. |
geography |
The geography of your data. Defaults to 'tract'. |
cache_table |
Whether or not to cache table names for faster future access. Defaults to FALSE; if TRUE, only needs to be called once per dataset. If variables dataset is already cached via the load_variables function, this can be bypassed. |
year |
The year, or endyear, of the ACS sample or Census. 2012 through 2018 are available for ACS and 2000 and 2010 for Census. Defaults to 2010. |
key |
Your Census API key. Obtain one at http://api.census.gov/data/key_signup.html |
seg_func |
a segregation function from the censeg package. Defaults to 'calc_theilsH' |
... |
Other parameters to pass to the seg_func. |
data frame with geography-race specific counts for a given state, county, or CBSA.
1 2 3 4 5 6 7 | # get segregation data by tract for all of King county Washington
census_seg("WA", "King")
# get segregation data by block group for all of Seattle metro area for 2015
census_seg(
metro = "Seattle-Tacoma-Bellevue, WA", geography = "block group",
year = 2015)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.