View source: R/jbplot_fwcrisk.R
jbplot_Crisk | R Documentation |
Plots plots JABBA ensemble models + projections - joint or by run
jbplot_Crisk(
prjc,
subplots = 2,
bfrac = 0.5,
bref = c("bmsy", "b0")[1],
years = NULL,
riskout = FALSE,
ylabs = NULL,
ylab.bref = NULL,
xlab = "Catch",
plot = TRUE,
as.png = FALSE,
col = NULL,
pch = NULL,
lty = 1,
lwd = 1.5,
tickEndYr = FALSE,
xlim = NULL,
ylimAdj = 1.05,
xaxs = "i",
yaxs = "i",
xylabs = TRUE,
type = "l",
legend = TRUE,
legendlabels = "default",
legend.loc = "topleft",
legendorder = "default",
legendncol = 1,
legendcex = 0.7,
legendsp = 0.8,
pwidth = 6.5,
pheight = 5,
punits = "in",
res = 300,
ptsize = 10,
cex.main = 1,
plotdir = NULL,
filenameprefix = "",
par = list(mar = c(5, 4, 1, 1) + 0.1),
verbose = FALSE,
shadecol = NULL,
shadealpha = 0.3,
new = TRUE,
add = FALSE,
single.plots = add,
fmax = 5
)
subplots |
option choose from subplots 1:7
|
bfrac |
biomass fraction of Bmsy or B0 (subplot 8), default 0.5Bmsy |
bref |
biomass fraction reference options c("bmsy","b0") |
riskout |
if TRUE, produces the kb data.frame as output |
ylabs |
yaxis labels for quants |
ylab.bref |
option to only specify BBfrac plot ylab final year of values to show for each model. By default it is set to the |
col |
Optional vector of colors to be used for lines. Input NULL |
pch |
Optional vector of plot character values |
lty |
Optional vector of line types |
lwd |
Optional vector of line widths |
tickEndYr |
TRUE/FALSE switch to turn on/off extra axis mark at final year in timeseries plots. |
xlim |
= NULL range of years |
ylimAdj |
Multiplier for ylim parameter. Allows additional white space |
xaxs |
Choice of xaxs parameter (see ?par for more info) |
yaxs |
Choice of yaxs parameter (see ?par for more info) |
type |
Type parameter passed to points (default 'o' overplots points on top of lines) |
legend |
Add a legend? |
legendlabels |
Optional vector of labels to include in legend. |
legend.loc |
Location of legend. Either a string like "topleft" or a vector of two numeric values representing the fraction of the maximum in the x and y dimensions, respectively. See ?legend for more info on the string options. |
legendorder |
Optional vector of model numbers that can be used to have the legend display the model names in an order that is different than that which is represented in the summary input object. |
legendncol |
Number of columns for the legend. |
legendsp |
Space between legend labels |
pwidth |
Width of plot |
pheight |
Height of plot |
punits |
Units for PNG file |
res |
Resolution for PNG file |
ptsize |
Point size for PNG file |
cex.main |
Character expansion for plot titles |
plotdir |
Directory where PNG or PDF files will be written. By default it will be the directory where the model was run. |
filenameprefix |
Additional text to append to PNG or PDF file names. It will be separated from default name by an underscore. |
par |
list of graphics parameter values passed to par() function |
verbose |
Report progress to R GUI? |
shadecol |
uncertainty shading of hcxval horizon |
shadealpha |
Transparency adjustment used to make default shadecol |
new |
Create new empty plot window |
add |
surpresses par() to create multiplot figs |
kb |
objects from fit_jabba(),jabba_fw(), list of fit_jabba() or fit_jabba()$kbtrj |
legendcex=1 |
Allows to adjust legend cex |
run |
name for single models or joint ensembles |
Mostly adopted from ss3diags::SSplotEnsemble
data(iccat)
bet = iccat$bet
# Fit Fox and Schaefer
jb1 <- build_jabba(catch=bet$catch,cpue=bet$cpue,se=bet$se,scenario = "Fox",model.type="Fox")
fit1 = fit_jabba(jb1,quickmcmc=TRUE,verbose=TRUE)
# Compare
jbplot_ensemble(fit1)
# Do forecast
prjc = fw_jabba(list(fit1,fit2),quant="Catch",type="abs",imp.values = seq(60,100,1)*1000)
jbplot_Crisk(prjc,subplots=1)
jbplot_Crisk(prjc,subplots=2)
jbplot_Crisk(prjc,subplots=3) # MSST as (1-0.5)*Bmsy with bfrac =0.5
jbplot_Crisk(prjc,subplots=3, bfrac=0.2,bref="b0") # Blim = 0.2 B0
jbplot_Crisk(prjc,subplots=3, bfrac=0.2,bref="b0",ylabs=expression(B/B[lim])) # Blim = 0.2 B0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.