View source: R/scatterEJ_D_E.R
scatterEJ_D_E | R Documentation |
scatterplot EJScreen Demog vs Envt vs EJ Index See one point per blockgroup, x=demog pctile, y=envt pctile, color=EJ pctile
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"),
...
)
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) |
Nothing. Draws a scatter plot.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.