Description Usage Arguments Value
This function takes in data and produces a census tract map of Oakland representing the variable using a gradient color scale. Census tract column must be named "tractid10".
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
data |
Data with a column containing census tracts and variable of interest. |
var |
Name of column containing variable to plot. |
shp_tracts |
"US_tract_2010.shp" loaded object |
palette |
Color palette: "sequential" (default) or "diverging" |
jenksbreaks |
Uses Jenks breaks when T, otherwise uses continuous color scale |
neg_bins |
For Jenks breaks, number of negative color bins. Default is 3. |
pos_bins |
For Jenks breaks, number of positive color bins. Default is 3. |
breaks |
Gradient scale breaks, either numeric vector or scales::extended_breaks(n = 6) |
labels |
Gradient scale labels, either character vector or scales::percent or scales::comma |
limits |
Manual limits for color scale, numeic vector: c(min, max) |
coord |
T if plotting coordinate values (lat, lon). Default is F. |
save |
T if user would like to return plot object and save file, F (default) to just return object. |
savename |
File name of map for saving. |
caption |
Figure caption |
Map of variable of interest.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.