Skip to contents

Used by ejscreen_vs()

Usage

ejscreen_vs_ejam(
  latlon,
  radius = 3,
  fips = NULL,
  shapefile = NULL,
  nadrop = FALSE,
  save_ejscreen_output = "ejscreenapi_plus_out.rda",
  save_when_report = FALSE,
  report_every_n = 250,
  calculate_ratios = FALSE,
  include_ejindexes = TRUE,
  x100fix = TRUE,
  x100varnames = names_pct_as_fraction_ejamit,
  showdrinkingwater = TRUE,
  showpctowned = TRUE,
  ...
)

Arguments

latlon

data.table or data.frame with colnames lat and lon, and one row per site

radius

in miles, used in ejamit() and ejscreenapi_plus()

fips

FIPS code(s) of counties or blockgroups, if not using latlon and radius.

save_ejscreen_output

set to NULL or FALSE to avoid saving ejscreen results locally. If specified as a valid path and filename ending in .rda, it saves there. If missing, function will prompt in interactive R session for a folder to use for saving the .rda results of ejscreenapi

save_when_report

see ejscreenapi_plus(), to save progress every so often just in case.

report_every_n

see ejscreenapi_plus()

calculate_ratios

passed to ejscreenapi_plus() and ejamit()

include_ejindexes

passed to ejscreenapi_plus() and ejamit()

x100fix

whether to multiply x100 in ejamit() outputs the names_d and names_d_subgroups indicator scores to convert fractions 0 to 1 into percentages of 0 to 100, prior to rounding and reporting EJAM results here.

x100varnames

optional, if x100fix = TRUE, a vector of colnames of x$EJAM to convert from being scaled as 0 to 1 into rescaled values of 0 to 100, because some outputs of EJSCREEN were reported as percentages 0 to 100 but as 0 to 1 in EJAM.

...

passed to ejamit() as any additional parameters

Value

a list of data frames, with names EJSCREEN, EJAM, EJSCREEN_shown, EJAM_shown, same_shown, ratio, diff, absdiff, pctdiff, abspctdiff

diff is EJAM - EJSCREEN

ratio is EJAM / EJSCREEN

pctdiff is ratio - 1

abs is absolute value

For each data.frame, colnames are indicators like pop, blockcount_near_site, etc. and rows represent sites analyzed.

Details

Consider using ejscreen_vs() which does this all interactively.

ejscreen_vs_ejam() and ejscreen_vs_ejam_alreadyrun() are used by ejscreen_vs()

See also

ejscreen_vs() which does it all interactively, and uses ejscreen_vs_ejam_alreadyrun() if appropriate.

Examples

 if (FALSE) { # \dontrun{
 # in RStudio, interactive:
 vs <- ejscreen_vs()
 
 # vs filtered to just the ones where rounded pop disagrees
 table(vs$same_shown$pop)
 vspopoff <- lapply(vs, function(x) x[!vs$same_shown$pop, ])
 
 pts2 <- testpoints_100[1:2, ]
 vs2 <- ejscreen_vs_ejam(pts2, radius = 1, save_ejscreen_output = F )
  } # }