demographics allows the user to pull out one or more demographic variables at several different geographic levels.
demographics(dem = "P0010001", state, statefips=FALSE, level = c("tract",
"blk", "blkgrp", "cdp", "msa", "county"), msaname=NULL)Character string or vector. Must be the actual name of the demographic variables attached to UScensus2010 objects. Default dem = " P0010001"
a character string, can either be the full name of a state (e.g. "oregon"), the abbreviation (e.g. "or"), or the FIPS code (e.g. "41")-- note that if you are using the FIPS code you have to change statefips to TRUE. This variable is insensitive to case.
logical, by default statefips=FALSE, set to TRUE if using the state FIPS codes.
a character string, takes levels tract, blk, blkgrp, cdp, msa or county
logical (optional), if level="msa", allows the use of the verbose MSA placename (capitalized).
An object of class matrix.
You must have the packages UScensus2010tract, UScensus2010blkgrp and UScensus2010blk installed to use levels "blkgrp" and "blk" respectively.
Zack W. Almquist (2010). US Census Spatial and Demographic Data in R: The UScensus2000 Suite of Packages. Journal of Statistical Software, 37(6), 1-31. https://www.jstatsoft.org/v37/i06/.
Census 2010 Summary File 1 [name of state1 or United States]/prepared by the U.S. Census Bureau, 20010. https://www.census.gov/prod/cen2010/doc/sf1.pdf
# NOT RUN {
#County Example
demographics(state="or",level="county")
# }
Run the code above in your browser using DataLab