Description Usage Arguments Value
View source: R/make_map_panel.R
This function takes in data and produces a panel of census tract maps of Oakland representing the variable using a gradient or discrete color scale, across distinct periods. Should have "tractid10" column for census tracts and "periods" column for distinct time periods.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
data |
Data with a column containing census tracts; 2, 3, or 4 distinct periods; 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 |
Gradient scale limits, 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 panel of variable of interest across 2, 3, or 4 periods.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.