plot_maps: Plot standard maps

View source: R/plot_maps.r

plot_mapsR Documentation

Plot standard maps

Description

plot_maps plots a standard set of diagnostic maps

Usage

plot_maps(
  plot_set = 3,
  fit,
  PlotDF,
  projargs = "+proj=longlat",
  Panel = "Category",
  year_labels = NULL,
  years_to_plot = NULL,
  category_names = NULL,
  quiet = FALSE,
  working_dir = getwd(),
  MapSizeRatio = NULL,
  n_cells,
  plot_value = "estimate",
  n_samples = 100,
  country = NULL,
  sample_fixed = TRUE,
  Report = fit$Report,
  TmbData = fit$data_list,
  Obj = fit$tmb_list$Obj,
  extrapolation_list = fit$extrapolation_list,
  Sdreport = fit$parameter_estimates$SD,
  Map = fit$tmb_list$Map,
  zlim = NULL,
  ...
)

Arguments

plot_set

integer-vector defining plots to create

plot_set=1

Link-transformed 1st linear predictor, Report$R1_gct

plot_set=2

Link-transformed 2nd linear predictor, logged for interpretable plotting scale, log(Report$R2_gct)

plot_set=3

Log-predicted density, derived from link-transform of both linear predictors, log(Report$D_gct)

plot_set=6

Spatio-temporal variation in 1st linear predictor (e.g., encounter probability when using a conventional delta-model), Report$Epsilon1_gct

plot_set=7

Spatio-temporal variation in 2nd linear predictor (e.g., log-positive catch rates when using a conventional delta-model), Report$Epsilon2_gct

plot_set=8

1st linear predictor, Report$P1_gct

plot_set=9

2nd linear predictor, Report$P2_gct

plot_set=11

Covariates that are included in the model for the 1st linear predictor, Report$X1_gcp

plot_set=12

Covariates that are included in the model for the 2nd linear predictor, Report$X2_gcp

plot_set=13

Total biomass across all categories (only useful in a multivariate model)

plot_set=14

Covariate effects on 1st linear predictor, Report$eta1_gct

plot_set=15

Covariate effects on 2nd linear predictor, Report$eta2_gct

plot_set=16

Spatial variation for 1st linear predictor, Report$Omega1_gc

plot_set=17

Spatial variation for 2nd linear predictor, Report$Omega2_gc

plot_set=18

Spatially-varying response for density covariates in 1st linear predictor, Report$Xi1_gcp

plot_set=19

Spatially-varying response for density covariates in 2nd linear predictor, Report$Xi2_gcp

plot_set=20

Spatially-varying response for catchability covariates in 1st linear predictor, Report$Phi1_gk

plot_set=21

Spatially-varying response for catchability covariates in 2nd linear predictor, Report$Phi2_gk

projargs

Character passed to CRS and see that documentation for description. See https://proj.org/operations/projections/index.html for a list of projections to pass via projargs. As a stable default please consider projargs='+proj=natearth +lon_0=0 +units=km' where argument +lon_0 allows the user to center eastings on a specified longitude.

Panel

Whether to plot years for a given category (Panel="Category") or categories for a given year (Panel="Year") in each panel figure

year_labels

character vector specifying names for labeling times t_i

years_to_plot

integer vector, specifying positions of year_labels for plotting (used to avoid plotting years with no data, etc.)

category_names

character vector specifying names for labeling categories c_i

MapSizeRatio

Default size for each panel

n_cells

Integer used to determine the argument cell.size passed to rasterize when converting output at extrapolation-grid cells to a raster prior to plotting mapped outputs using plot_variable. An increased n_cells results in a decreased cell.size and hence higher resolution plots. The default value for n_cells will often need to be modified for a given purpose.

plot_value

either plot_value="estimate" (the default), or a user-specified function that is applied to n_samples samples from the joint predictive distribution, e.g., to visualize the standard error of a variable by specifying plot_value=sd

n_samples

number of samples from the joint predictive distribution for fixed and random effects. Default is 100, which is slow.

country

optional list of countries to display, e.g. country = c("united states of america", "canada"). If maps are generating visual artefacts, please try using argument country to simplify the polygons used to represent land features.

sample_fixed

whether to sample fixed and random effects, sample_fixed=TRUE as by default, or just sample random effects, sample_fixed=FALSE

Report

tagged list of outputs from TMB model via Obj$report()

Obj

Fitted TMB object from package 'VAST', i.e., output from 'fit_model(...)$tmb_list$Obj'

Sdreport

Standard deviation outputs from TMB model via sdreport(Obj)

zlim

two numeric values, specifying range for defining bounds of color scale. If zlim=NULL, then a constant scale is inferred from the range of the plotted variable and a color-legend is plotted in the last panel. If zlim=NA then a different range is used in each panel from the range of Y_gt[,t] and a color-legend is plotted in every panel.

...

arguments passed to plot_variable

Value

Mat_xt a matrix (rows: modeled knots; column: modeled year) for plotted output of last element of plot_set


James-Thorson/FishStatsUtils documentation built on Feb. 6, 2024, 4:26 a.m.