plot,VGMSFH-method {vmsae} | R Documentation |
Plot VGMSFH Result
Description
This method plots spatial summaries of results from a VGMSFH
object, including model estimates and comparisons with direct estimates.
Usage
## S4 method for signature 'VGMSFH'
plot(x, shp = NULL, var_idx = 1, type = "compare", verbose = TRUE)
Arguments
x |
An object of class |
shp |
An |
var_idx |
Integer. The index of the variable of interest (for multivariate models). |
type |
Character. The type of plot to generate. Options are:
|
verbose |
Logical; if |
Details
The function provides spatial visualization of model results. It supports both univariate and multivariate response settings. When type = "compare"
, it generates side-by-side choropleth maps for the direct and model-based estimates. When type = "estimate"
, it plots the posterior mean and standard deviation of the VGMSFH model output.
If no shapefile is provided, a default geometry is loaded from the pretrained repository.
Value
A ggplot
object. The plot is rendered to the active device.
Examples
library(vmsae)
library(sf)
example_model <- readRDS(system.file("example", "example_model.Rds", package = "vmsae"))
example_shp <- read_sf(system.file("example", "mo_county.shp", package = "vmsae"))
plot(example_model, shp = example_shp, type = "compare")
plot(example_model, shp = example_shp, type = "estimate", var_idx = 2)