scatterPlot.web: web-based scatter plot

scatterPlot.webR Documentation

web-based scatter plot

Description

interactive scatter plot comparing estimates from two methods for the same admin level

Usage

scatterPlot.web(
  res.obj.x,
  res.obj.y,
  value.to.plot = "mean",
  label.x = "Method 1 Estimates",
  label.y = "Method 2 Estimates",
  plot.title = NULL,
  interactive = T
)

Arguments

res.obj.x

result object from surveyPrev

res.obj.y

result object from surveyPrev

value.to.plot

which statistics to plot 'mean'

label.x

label on x-axis

label.y

label on y-axis

plot.title

title for the plot

interactive

whether to render interactive or static plot

Value

plotly or ggplot2 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")
res_adm2_cl <- clusterModel(data=data,
                  cluster.info = cluster.info,
                  admin.info = admin.info2,
                  model = "bym2",
                  admin = 2)
res_adm2_fh <- fhModel(data=data,
                  cluster.info = cluster.info,
                  admin.info = admin.info2,
                  model = "bym2",
                  admin = 2)

scatterPlot.web(res_adm2_cl, res_adm2_fh)

## End(Not run)


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