Skip to contents

Map - County polygons / boundaries - Create leaflet or static map of results of analysis

Usage

mapfastej_counties(
  mydf,
  colorvarname = "pctile.Demog.Index.Supp",
  colorfills = c("yellow", "orange", "red"),
  colorlabels = c(80, 90, 95),
  colorbins = c(80, 90, 95),
  colorpalette = c("yellow", "yellow", "orange", "red"),
  static_not_leaflet = FALSE,
  main = "Selected Counties",
  ...
)

Arguments

mydf

something like ejamit(fips = fips_counties_from_statename("Kentucky"), radius = 0)$results_bysite

colorvarname

colname of indicator in mydf that drives color-coding (or alternatively, colorvarname = "green" means a single specific color for all, like "green")

colorfills

= c('yellow', 'orange', 'red')

colorlabels

= c(80, 90, 95)

colorbins

= c(80, 90, 95)

colorpalette

= c("yellow", "yellow", "orange", "red")

static_not_leaflet

set TRUE to use map_shapes_plot() instead of map_shapes_leaflet()

main

title for map

...

passed to map_shapes_plot() if relevant

Value

leaflet html widget (but if static_not_leaflet=T, returns just shapes_counties_from_countyfips(mydf$ejam_uniq_id))

Details

THIS ASSUMES THAT mydf$ejam_unique_id is the county FIPS codes

Examples

if (FALSE) { # \dontrun{
 fips_ky <- fips_counties_from_statename("Kentucky")
 x <- ejamit(fips = fips_ky, radius = 0)
 mapfastej_counties(x$results_bysite)
 } # }
 # map_shapes_leaflet(shapes = shapes_counties_from_countyfips(fips_ky))