plotSpatialTerm: Plot Spatial Term

Description Usage Arguments Warning See Also

View source: R/plotSpatialTerm.R

Description

Plots summaries of the spatial term estimates from a fitted FCS2 model on a map of the spatial regions.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
plotSpatialTerm(
  map,
  fit,
  type = "mean",
  abundance = TRUE,
  prevalence = TRUE,
  posterior = !is.null(fit$bugsFit),
  inla = !posterior,
  ...
)

Arguments

map

a SpatialPolygonsDataFrame object containing polygons and a data frame corresponding to the regions used for a spatial term in the FCS2 model. This will usually be generated from an ESRI shapefile using readShapePoly.

fit

an "fcs2Fit" object containing INLA or BUGS model fits, as returned from fcs2FitModel. The model should include a spatial term in the abundance and/or prevalence component which is based upon the region given by map.

type

which summary to plot. Either "mean" for the mean or "sd" for the standard deviation, or both.

abundance

whether the spatial term (with these regions) is in the abundance regression component and should be plotted.

prevalence

whether the spatial term (with these regions) is in the prevalence regression component and should be plotted.

posterior

whether to plot the posterior estimates of the spatial term (if available).

inla

whether to plot the approximate INLA estimates of the spatial term.

...

further arguments passed to spplot and perhaps on further to levelplot. For example, the colour pallete can be changed using col.regions which by default is set using cm.colors.

Warning

This function requires the additional package sp to provide the SpatialPolygonsDataFrame map. This package is one of the requirements of the package maptools which may also be useful for creating map from an ESRI shapefile using the function readShapePoly.

See Also

fcs2SpatialSummary which this function uses to attach the spatial summaries to the map before plotting.


aquaMetrics/fcs2 documentation built on Aug. 21, 2021, 12:55 p.m.