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

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.

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)
#> Warning: warning, low sample size of adult females in at least one year
#> using Kaplan-Meier survival model

out_tbl <- getOutputTables(out, exData = simO$exData, paramTable = simO$paramTable,
                           simNational = getSimsNational(), getKSDists = FALSE)
#> Using saved object

plotRes(out_tbl, parameter = "Recruitment")