Skip to contents

Takes the output of ejamit() and uses mapfastej() to create a map of the points.

Usage

ejam2map(
  ejamitout,
  column_names = "ej",
  launch_browser = TRUE,
  shp = NULL,
  radius = NULL,
  sitenumber = NULL,
  shape = NULL,
  shapefile = NULL,
  buffer = NULL,
  sitenumber_label = NULL
)

Arguments

ejamitout

output of ejamit()

column_names

can be "ej", passed to mapfast()

launch_browser

logical optional whether to open the web browser to view the map

shp

shapefile it can map if analysis was for polygons, for example

radius

optional radius in miles

sitenumber

Optional integer. If a valid positive integer is provided, only that one site (row sitenumber of ejamitout$results_bysite) is mapped. If omitted, NULL, zero, negative, or out of range, all sites are mapped. Works for all site types (latlon, fips, shp): when sitetype is "fips" and shp is provided, both the results table and shp are subsetted to the requested row; when shp is not provided, the FIPS polygon is downloaded for only that one site.

shape

alias (synonym) for shp

shapefile

alias (synonym) for shp

buffer

alias (synonym) for radius

sitenumber_label

optional, display-only override (a number or short text) of the site number shown in map popups, in place of the auto-assigned row number/ejam_uniq_id. Only relevant when mapping a single site – see ejam2report(), whose sitenumber_label parameter this supports.

Value

like what mapfastej() returns

Details

Gets radius by checking ejamitout$results_overall$radius.miles You can use browse=TRUE to save it as a shareable .html file and see it in your web browser.

Examples

pts = testpoints_100
mapfast(pts)

# out = ejamit(pts, radius = 1)
out = testoutput_ejamit_100pts_1miles

# See in RStudio viewer pane
ejam2map(out, launch_browser = FALSE)
mapfastej(out$results_bysite[c(12,31),])
if (FALSE) { # \dontrun{

# See in local browser instead
ejam2map(out)

# Open folder where interactive map
#  .html file is saved, so you can share it:
x = ejam2map(out)
fname = map2browser(x)
# browseURL(normalizePath(dirname(fname))) # to open the temp folder
# file.copy(fname, "./map.html") # to copy map file to working directory

} # }