Description Usage Arguments Value References See Also Examples
Creates a choropleth using the US Census' American Community Survey (ACS) data. Requires the acs package to be installed, and a Census API Key to be set with the acs's api.key.install function. Census API keys can be obtained at http://www.census.gov/developers/tos/key_request.html.
1 2 | choroplethr_acs(tableId, map, endyear = 2011, span = 5, buckets = 7,
zoom = NULL)
|
tableId |
The id of an ACS table |
map |
A string indicating which map the data is for. Must be "state", "county" or "zip". |
endyear |
The end year of the survey to use. See acs.fetch (?acs.fetch) and http://1.usa.gov/1geFSSj for details. |
span |
The span of time to use. See acs.fetch and http://1.usa.gov/1geFSSj for details. on the same longitude and latitude map to scale. This variable is only checked when the "states" variable is equal to all 50 states. |
buckets |
The number of equally sized buckets to places the values in. A value of 1 will use a continuous scale, and a value in [2, 9] will use that many buckets. |
zoom |
An optional list of states to zoom in on. Must come from the "name" column in ?state.regions. |
A choropleth.
Uses the acs package created by Ezra Haber Glenn.
api.key.install
in the acs package which sets an Census API key for the acs library
http://factfinder2.census.gov/faces/help/jsf/pages/metadata.xhtml?lang=en&type=survey&id=survey.en.ACS_ACS which contains a list of all ACS surveys.
1 2 3 4 5 6 7 8 9 10 | ## Not run:
# population of all states, 9 equally sized buckets
choroplethr_acs("B01003", "state")
# median income, continuous scale, counties in New York, New Jersey and Connecticut
choroplethr_acs("B19301", "county", buckets=1, zoom=c("new york", "new jersey", "connecticut"))
# median income, all zip codes
choroplethr_acs("B19301", "zip")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.