Description Usage Arguments References Examples
The data comes from the American Community Survey (ACS). The variables are: total population, percent White not Hispanic, Percent Black or African American not Hispanic, percent Asian not Hispanic, percent Hispanic all races, per-capita income, median rent and median age.
1 | get_ca_tract_demographics(endyear = 2013, span = 5)
|
endyear |
The end year for the survey |
span |
The span of the survey |
The choroplethr guide to Census data: http://cran.r-project.org/web/packages/choroplethr/vignettes/e-mapping-us-census-data.html
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
df = get_ca_tract_demographics(endyear=2010, span=5)
colnames(df)
# analyze the percent of people who are white not hispanic
# a boxplot shows the distribution
boxplot(df$percent_white)
# a choropleth map shows the location of the values in california
# set the 'value' column to be the column we want to render
df$value = df$percent_white
ca_tract_choropleth(df,
title="2010 Census Tracts\nPercent White not Hispanic",
legend="Percent")
# zoom into san francisco county
ca_tract_choropleth(df,
title="2010 Census Tracts\nPercent White not Hispanic",
legend="Percent",
county_zoom=6075)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.