plotRes: Plot Bayesian population model results

View source: R/plotRes.R

plotResR Documentation

Plot Bayesian population model results

Description

Plot Bayesian population model results, with (optionally) the distribution of outcomes from the national model, local observations, and true local state for comparison.

Usage

plotRes(
  modTables,
  parameter,
  lowBound = 0,
  highBound = 1,
  facetVars = NULL,
  labFontSize = 14,
  ksDists = FALSE,
  legendPosition = "right",
  breakInterval = 1
)

Arguments

modTables

list. A list of model results tables created using ⁠[getOutputTables()]⁠.

parameter

character. Which parameter to plot, if more than one, a list of plots is returned.

lowBound, highBound

numeric. Lower and upper y axis limits

facetVars

character. Optional. Vector of column names to facet by

labFontSize

numeric. Optional. Label font size if there are not facets. Font size is 10 pt if facets are used.

ksDists

logical. If true the modTables$ksDists table is used to create plots for each parameter.

legendPosition

"bottom", "right", "left","top", or "none". Legend position.

breakInterval

number. How many years between x tick marks?

Value

a ggplot object or list of ggplot objects if a vector of parameters was given.

See Also

Caribou demography functions: caribouBayesianPM(), caribouPopGrowth(), compositionBiasCorrection(), demographicCoefficients(), demographicProjectionApp(), demographicRates(), getOutputTables(), getPriors(), getScenarioDefaults(), getSimsNational(), popGrowthTableJohnsonECCC, runScnSet(), simulateObservations()

Examples

scns <- getScenarioDefaults(projYears = 10, obsYears = 10,
                            obsAnthroSlope = 1, projAnthroSlope = 5,
                            collarCount = 20, cowMult = 5)

simO <- simulateObservations(scns)

out <- caribouBayesianPM(survData = simO$simSurvObs, ageRatio = simO$ageRatioOut,
                          disturbance = simO$simDisturbance,
                          startYear = 2014, Nchains = 1, Niter = 100, Nburn = 10,
                          Nthin = 2)

out_tbl <- getOutputTables(out, exData = simO$exData, paramTable = simO$paramTable,
                           simNational = getSimsNational(), getKSDists = FALSE)

plotRes(out_tbl, parameter = "Recruitment")

LandSciTech/caribouMetrics documentation built on Feb. 25, 2025, 9:34 a.m.