plot_lollipop: Produce lollipop plot by ethnoracial, income, and...

Description Usage Arguments Value

View source: R/plot_lollipop.R

Description

This function takes in data and produces a horizontal lollipop plot by ethnoracial, income, and gentrification category. The order of these categories can be adjusted by changing the factor levels of the facet variable. Input data needs columns for variable of interest (titled "var") and tract number (titled "tractid10"). Intended to be used after oakViz::aggregate_categories().

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
plot_lollipop(
  data,
  var,
  limits,
  panel = F,
  var2 = NULL,
  panel_titles = NULL,
  x_title = NULL,
  scale_type = "numeric",
  save = F,
  savename = "plot.png",
  caption = paste0(frb_acs_caption_splitline, ses_caption)
)

Arguments

data

Data with column for variable of interest.

var

Column name of variable of interest.

limits

Y-axis limits.

panel

If T, creates horizontal panel of 2 plots

var2

Column name of second variable of interest, if panel = T

panel_titles

Vector of 2 strings containing titles for plots in panel

x_title

Title to display along x-axis

scale_type

Y-axis scale type: "numeric" or "percent"

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

Lollipop plot of variable by ethnoracial, income, and gentrification category, with optional columns by SES.


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