make_map: Produce King County map of continuous variable with gradient...

Description Usage Arguments Value

View source: R/make_map.R

Description

This function takes in data and produces an HRA map of King County representing the variable using a gradient color scale. HRA column must be named "HRA".

Usage

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

Arguments

data

Data with a column containing HRAs and variable of interest.

var

Name of column containing variable to plot.

shp_file

Hra shape file

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.

title

Title of figure

caption

Figure caption

Value

Map of variable of interest.


Changing-Cities-Research-Lab/seattleViz documentation built on April 14, 2021, 3:47 p.m.