prevMap.web: leaflet (interactive) prevalence map for any subnational...

View source: R/fct_visualization.R

prevMap.webR Documentation

leaflet (interactive) prevalence map for any subnational level

Description

produce interactive map for any subnational level, with the option to focus on one admin-1 level

Usage

prevMap.web(
  res.obj,
  poly.shp,
  admin1.focus = NULL,
  color.palette = NULL,
  value.to.plot = "mean",
  value.range = NULL,
  num_bins = NULL,
  legend.label = "Estimates",
  map.title = NULL,
  color.reverse = T,
  no.hatching = F,
  hatching.density = 12,
  use.basemap = NULL,
  threshold.p = NULL,
  legend.color.reverse = T
)

Arguments

res.obj

result object from surveyPrev

poly.shp

polygon file for plotting

admin1.focus

if needed, the admin 1 level area name to create an individual focused prevalence map on

color.palette

which palette to use for plotting

value.to.plot

statistics to appear on the map

value.range

what range to plot, useful if want to compare plots using the same scale

num_bins

number of bins on the legend (what displayed might not be exact)

legend.label

label for the legend, such as 'Coefficient of Variation'

map.title

title for the map

color.reverse

whether to use reverse color scale

no.hatching

whether to hatch region with problematic uncertainties, recommend F (depends on rgeos package, set to T if not installed)

hatching.density

density of the hatching lines

use.basemap

what basemap to use 'OSM', if NULL, no basemap

threshold.p

cutoff for the exceedance probability map

legend.color.reverse

logical indicator of reversing the color legend

Value

leaflet map object

Examples

## Not run: 
geo <- getDHSgeo(country = "Zambia", year = 2018)
cluster.info <- clusterInfo(geo = geo,
                            poly.adm1 = ZambiaAdm1,
                            poly.adm2 = ZambiaAdm2)
# "RH_ANCN_W_N4P" is an indicator for having more than four ANC visits.
#  In previous versions of the package, it is labeled "ancvisit4+".
dhsData <- getDHSdata(country = "Zambia",
                                 indicator = "RH_ANCN_W_N4P",
                                 year = 2018)
data <- getDHSindicator(dhsData, indicator = "RH_ANCN_W_N4P")
poly.adm2 <- sf::st_as_sf(ZambiaAdm2)
admin.info2 <- adminInfo(poly.adm = poly.adm2, 
                         admin = 2, 
                         by.adm = "NAME_2", 
                         by.adm.upper = "NAME_1")
cl_res_ad2 <- clusterModel(data=data,
                  cluster.info = cluster.info,
                  admin.info = admin.info2,
                  model = "bym2",
                  admin = 2)
prevMap.adm2.central <- prevMap.web(res.obj=cl_res_ad2, 
                                              poly.shp=poly.adm2,
                                              admin1.focus = "Central")

## End(Not run) 


surveyPrev documentation built on June 19, 2026, 5:06 p.m.