Make squid plot of retrospectives of recruitment deviations.
Source:R/SSplotRetroRecruits.R
SSplotRetroRecruits.Rd
Inspired by Jim Ianelli and named by Sean Cox, the squid plot is a way to examine retrospective patterns in estimation of recruitment deviations.
Usage
SSplotRetroRecruits(
retroSummary,
endyrvec,
cohorts,
ylim = NULL,
uncertainty = FALSE,
labels = c("Recruitment deviation", "Recruitment (billions)",
"relative to recent estimate", "Age"),
main = "Retrospective analysis of recruitment deviations",
mcmcVec = FALSE,
devs = TRUE,
relative = FALSE,
labelyears = TRUE,
legend = FALSE,
leg.ncols = 4
)
Arguments
- retroSummary
List object created by
SSsummarize()
that summarizes the results of a set of retrospective analysis models.ss- endyrvec
Vector of years representing the final year of values to show for each model.
- cohorts
Which cohorts to show in plot.
- ylim
Limits of y-axis.
- uncertainty
Show uncertainty intervals around lines? (This can get a bit busy.)
- labels
Vector of labels for plots (titles and axis labels).
- main
Title for plot.
- mcmcVec
Either vector of TRUE/FALSE values indicating which models use MCMC. Or single value applied to all models.
- devs
Plot deviations instead of absolute recruitment values?
- relative
Show deviations relative to most recent estimate or relative to 0.
- labelyears
Label cohorts with text at the end of each line?
- legend
Add a legend showing which color goes with which line (as alternative to
labelyears
).- leg.ncols
Number of columns for the legend.
References
Ianelli et al. (2011) Assessment of the walleye pollock stock in the Eastern Bering Sea. (Figure 1.31, which is on an absolute, rather than log scale.)
Examples
if (FALSE) { # \dontrun{
# run retrospective analysis
retro(olddir = "2013hake_12", years = 0:-10)
# read in output
retroModels <- SSgetoutput(dirvec = paste("retrospectives/retro", -10:0, sep = ""))
# summarize output
retroSummary <- SSsummarize(retroModels)
# set the ending year of each model in the set
endyrvec <- retroModels[[1]][["endyr"]] - 10:0
# make comparison plot
pdf("retrospectives/retrospective_comparison_plots.pdf")
SSplotComparisons(retroSummary, endyrvec = endyrvec, new = FALSE)
dev.off()
# make Squid Plot of recdev retrospectives
pdf("retrospectives/retrospective_dev_plots.pdf", width = 7, height = 10)
par(mfrow = c(2, 1))
# first scaled relative to most recent estimate
SSplotRetroRecruits(retroSummary,
endyrvec = endyrvec, cohorts = 1999:2012,
relative = TRUE, legend = FALSE
)
# second without scaling
SSplotRetroDevs(retroSummary,
endyrvec = endyrvec, cohorts = 1999:2012,
relative = FALSE, legend = FALSE
)
dev.off()
} # }