make_map_panel: Produce Oakland map panel of continuous variable with...

Description Usage Arguments Value

View source: R/make_map_panel.R

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
make_map_panel(
  data,
  var,
  shp_tracts,
  palette = "sequential",
  jenksbreaks = T,
  neg_bins = 3,
  pos_bins = 3,
  breaks = scales::extended_breaks(n = 6),
  labels = scales::percent,
  limits = NULL,
  coord = F,
  save = F,
  savename = "plot.png",
  caption = paste0(frb_caption, ses_caption, period_caption)
)

Arguments

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

Value

Map panel of variable of interest across 2, 3, or 4 periods.


Changing-Cities-Research-Lab/oakViz documentation built on May 13, 2021, 7:19 p.m.