ward_prep: Order race values before plot

Description Usage Arguments Value

View source: R/ward_prep.R

Description

Function to order race consistently for graph colors. Dataframe must have a race column with values matching those in ward_vector_order. Should run before running plotly.

Usage

1
2
3
4
5
6
ward_prep(
  df,
  ward_col = "a.ward",
  ward_vector_order = c("Ward 1", "Ward 2", "Ward 3", "Ward 4", "Ward 5", "Ward 6",
    "OOC", "UNK")
)

Arguments

df

a stops or arrests dataframe with a ward column

ward_col

a column for ward values in the arrest/stops dataframe

ward_vector_order

character vector of how to order wards in visualizations/charts

Value

df with race column ordered as factor


dpowerstp/arrprocess documentation built on Dec. 20, 2021, 1:12 a.m.