Learn R Programming

r4ss (version 1.15)

SSplotComparisons: plot model comparisons

Description

Creates a user-chosen set of plots comparing model output from a summary of multiple models, where the collection was created using the SSsummarize function.

Usage

SSplotComparisons(summaryoutput,subplots=1:13,
  plot=TRUE,print=FALSE,
  models="all",
  endyrvec=NULL,
  indexfleets=NULL,
  indexUncertainty=FALSE,
  indexSEvec="default",
  indexPlotEach=FALSE,         
  labels=c("Year",             
    "Spawning biomass (mt)",   
    "Spawning depletion",      
    "Age-0 recruits (1,000s)", 
    "Recruitment deviations",  
    "Index",                   
    "Log index",               
    "Density"),                
  col="default", shadecol="default",
  pch="default", lty=1, lwd=2,
  xlim="default", xaxs="r", yaxs="r",
  type="o", uncertainty=TRUE, shadealpha=0.1,
  legend=TRUE, legendlabels="default", legendloc="topright",
  btarg=0.4, minbthresh=0.25,
  pwidth=7,pheight=7,punits="in",res=300,ptsize=12,cex.main=1,
  plotdir=NULL,
  densitynames=c("SPB_Virgin",
                 "SPB_2011",
                 "Bratio_2011",
                 "SR_R0",
                 "TotYield_MSY"),
  densityxlabs=c("B0 (mt)",
                 "Spawning Biomass in 2011 (mt)",
                 "depletion in 2011",
                 "log(R0)",
                 "MSY (mt)"),
  densityscalex=1,
  densityscaley=1,
  fix0=TRUE,
  new=TRUE,
  verbose=TRUE,
  mcmcVec="default")

Arguments

summaryoutput
list created by SSsummarize
subplots
Vector of subplots to be created.
plot
plot to active plot device?
print
send plots to PNG files in directory specified by plotdir
models
optional subset of the models described in summaryoutput. Either "all" or a vector of numbers indicating columns in summary tables.
endyrvec
optional single year or vector of years representing the final year of values to show for each model
indexfleets
vector of fleets for each model for which to compare indices of abundance. Only necessary if any model has more than one index.
indexUncertainty
show uncertainty intervals on index data? Default=FALSE because if models have any extra standard deviations added, these intervals may differ across models.
indexSEvec
optional replacement for the SE values in summaryoutput$indices to deal with the issue of differing uncertainty by models described above.
indexPlotEach
TRUE plots the observed index for each model with colors, or FALSE just plots observed once in black dots.
labels
vector of labels for plots (titles and axis labels)
col
optional vector of colors to be used for lines. Input 'default' makes use of rich.colors.short function.
shadecol
optional vector of colors to be used for shading uncertainty intervals. Input 'default' makes use of rich.colors.short function with alpha transparency.
pch
optional vector of plot character values
lty
optional vector of line types
lwd
optional vector of line widths
xlim
optional x limits
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)
uncertainty
show plots with uncertainty intervals
shadealpha
transparency parameter used to make default shadecol values (see ?rgb for more info)
legend
add a legend?
legendlabels
optional vector of labels to include in legend. Default is 'model1','model2',etc.
legendloc
location of legend. See ?legend for more info.
btarg
target biomass value at which to show a line (set to 0 to remove)
minbthresh
minimum biomass threshhold at which to show a line (set to 0 to remove)
pwidth
width of plot written to PNG file
pheight
height of plot written to PNG file
punits
units for PNG file
res
resolution for PNG file
ptsize
ptsize 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.
densitynames
vector of names of parameters or derived quantities contained in summaryoutput$pars$Label or summaryoutput$quants$Label for which to make density plots
densityxlabs
vector of x-axis labels to use in the density plots (must be equal in length to densitynames)
densityscalex
scalar for upper x-limit in density plots (values below 1 will cut off the right tail to provide better contrast among narrower distributions
densityscaley
scalar for upper y-limit in density plots (values below 1 will cut off top of highest peaks to provide better contrast among broader distributions
fix0
always include 0 in the density plots?
new
create new empty plot window
verbose
report progress to R GUI?
mcmcVec
vector of TRUE/FALSE values (or single value) indicating whether input values are from MCMC or to use normal distribution around MLE

Value

    See Also

    SS_plots, SSsummarize, SS_output, SSgetoutput