scatterEJ_D_E: scatterplot EJScreen Demog vs Envt vs EJ Index See one point...

View source: R/scatterEJ_D_E.R

scatterEJ_D_ER Documentation

scatterplot EJScreen Demog vs Envt vs EJ Index See one point per blockgroup, x=demog pctile, y=envt pctile, color=EJ pctile

Description

scatterplot EJScreen Demog vs Envt vs EJ Index See one point per blockgroup, x=demog pctile, y=envt pctile, color=EJ pctile

Usage

scatterEJ_D_E(
  d,
  e,
  ejbin,
  ename = "",
  legendtitle = "Percentiles of EJ Index (with yellow/orange/red as in the maps)",
  colors11 = c("white", "lightgray", "lightgreen", "darkgray", "purple", "black",
    "darkblue", "lightblue", "yellow", "orange", "red"),
  main =
    "What combinations of E and D result in EJ Index being in various bins\n so that place is shown on maps as in a given color-coded EJ Index percentile bin",
  mylegend = c("<10", "10-20", "20s", "30s", "40s", "50-60", "60s", "70s", "80-90",
    "90-95", ">95"),
  ...
)

Arguments

d

vector percentile demographic index

e

vector percentile environmental indicator

ejbin

vector bin number 1 through N (bins of percentiles) for EJ Index for e

ename

friendly name for graphic, optional

legendtitle

optional

colors11

optional

main

optional

mylegend

vector of text labels for the N bins

...

passed to plot (but not to points for the various colors subsets)

Value

Nothing. Draws a scatter plot.

Examples

 ## Not run: 
 if (require(ejscreen)) {
 bg = ejscreen::bg22
 dd = bg$pctile.VSI.eo
 ee = bg$pctile.traffic.score
 jj = bg$bin.EJ.DISPARITY.traffic.score.eo
 scatterEJ_D_E(d=dd, e = ee, ejbin = jj, ename = "Traffic Score")
 }

 if (require(EJAM)) {
 bg = data.table(copy(EJAM::blockgroupstats))
 ee = with(EJAM::blockgroupstats, as.vector(100 * make.pctile.cols(
   traffic.score, as.df = F)) )
 dd = with(blockgroupstats, as.vector(100 * make.pctile.cols(
   VSI.eo, as.df = F)))
 jj = with(blockgroupstats, as.vector(1 * make.bin.cols( as.vector(make.pctile.cols(
   EJ.DISPARITY.traffic.score.eo, as.df = FALSE)), as.df = F)))
 scatterEJ_D_E(d=dd, e = ee, ejbin = jj, ename = "Traffic Score")
 }

## End(Not run)

ejanalysis/ejanalysis documentation built on April 2, 2024, 10:12 a.m.