Package: r4ss 1.50.0

Ian G. Taylor

r4ss: R Code for Stock Synthesis

A collection of R functions for use with Stock Synthesis, a fisheries stock assessment modeling platform written in ADMB by Dr. Richard D. Methot at the NOAA Northwest Fisheries Science Center. The functions include tools for summarizing and plotting results, manipulating files, visualizing model parameterizations, and various other common stock assessment tasks. This version of '{r4ss}' is compatible with Stock Synthesis versions 3.24 through 3.30 (specifically version 3.30.22, from October 2023). Support for 3.24 models is only through the core functions for reading output and plotting.

Authors:Ian G. Taylor [aut, cre], Ian J. Stewart [aut], Allan C. Hicks [aut], Tommy M. Garrison [aut], Andre E. Punt [aut], R.I.C. Chris Francis [aut], John R. Wallace [aut], Chantel R. Wetzel [aut], James T. Thorson [aut], Yukio Takeuchi [aut], Kotaro Ono [aut], Cole C. Monnahan [aut], Christine C. Stawitz [aut], Z. Teresa A'mar [aut], Athol R. Whitten [aut], Kelli F. Johnson [aut], Robbie L. Emmet [aut], Sean C. Anderson [aut], Gwladys I. Lambert [aut], Megan M. Stachura [aut], Andrew B. Cooper [aut], Andi Stephens [aut], Neil L. Klaer [aut], Carey R. McGilliard [aut], Iago Mosqueira [aut], Watal M. Iwasaki [aut], Kathryn L. Doering [aut], Andrea M. Havron [aut], Nathan R. Vaughan [aut], LaTreese S. Denson [aut], Ashleigh J. Novak [aut], Henning Winker [aut], Lee Qi [aut], Megumi Oshima [aut], Eric Fletcher [aut], Elizabeth F. Gugliotti [aut], Kiva L. Oken [aut]

r4ss_1.50.0.tar.gz
r4ss_1.50.0.zip(r-4.5)r4ss_1.50.0.zip(r-4.4)r4ss_1.50.0.zip(r-4.3)
r4ss_1.50.0.tgz(r-4.4-any)r4ss_1.50.0.tgz(r-4.3-any)
r4ss_1.50.0.tar.gz(r-4.5-noble)r4ss_1.50.0.tar.gz(r-4.4-noble)
r4ss_1.50.0.tgz(r-4.4-emscripten)r4ss_1.50.0.tgz(r-4.3-emscripten)
r4ss.pdf |r4ss.html
r4ss/json (API)
NEWS

# Install 'r4ss' in R:
install.packages('r4ss', repos = c('https://k-doering-noaa.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/r4ss/r4ss/issues

On CRAN:

fisheriesfisheries-stock-assessmentstock-synthesis

11.32 score 38 stars 2 packages 1.0k scripts 532 downloads 1 mentions 115 exports 81 dependencies

Last updated 5 days agofrom:cd639a9e61. Checks:OK: 1 NOTE: 4 ERROR: 2. Indexed: no.

TargetResultDate
Doc / VignettesOKNov 18 2024
R-4.5-winNOTENov 18 2024
R-4.5-linuxNOTENov 18 2024
R-4.4-winNOTENov 18 2024
R-4.4-macERRORNov 18 2024
R-4.3-winNOTENov 18 2024
R-4.3-macERRORNov 18 2024

Exports:add_legendcalc_var_adjustcheck_execopy_SS_inputsDoProjectPlotsdownload_modelsget_SIS_infoget_ss3_exegetADMBHessianis.wholenumberjittermake_multifigmake_multifig_sexratiomcmc.nuisancemcmc.outmountainsNegLogInt_FnPinerPlotpopulate_multiple_foldersprofileread.admbFitretrorich.colors.shortrunsave_pngselShapesSS_changeparsSS_decision_table_stuffSS_doRetroSS_fitbiasrampSS_ForeCatchSS_htmlSS_makeHTMLdiagnostictableSS_outputSS_parlinesSS_plotsSS_profileSS_readSS_read_summarySS_readctlSS_readctl_3.24SS_readctl_3.30SS_readdatSS_readdat_2.00SS_readdat_3.00SS_readdat_3.24SS_readdat_3.30SS_readforecastSS_readpar_3.24SS_readpar_3.30SS_readstarterSS_readwtatageSS_recdevsSS_RunJitterSS_Sensi_plotSS_splitdatSS_tune_compsSS_varadjustSS_writeSS_writectlSS_writectl_3.24SS_writectl_3.30SS_writedatSS_writedat_3.24SS_writedat_3.30SS_writeforecastSS_writepar_3.24SS_writepar_3.30SS_writestarterSS_writewtatageSSbiologytablesSSdiagsTime2YearSSexecutivesummarySSgetMCMCSSgetoutputSSmakeMmatrixSSMethod.Cond.TA1.8SSMethod.TA1.8SSmohnsrhossparSSplotAgeMatrixSSplotBiologySSplotCatchSSplotCohortCatchSSplotComparisonsSSplotCompsSSplotDataSSplotDiscardSSplotDynamicB0SSplotIndicesSSplotMCMC_ExtraSelexSSplotMnwtSSplotMovementMapSSplotMovementRatesSSplotNumbersSSplotParsSSplotProfileSSplotRecdevsSSplotRecdistSSplotRetroRecruitsSSplotSelexSSplotSexRatioSSplotSpawnrecruitSSplotSPRSSplotSummaryFSSplotTagsSSplotTimeseriesSSplotYieldSSsummarizeSStableComparisonsSSunavailableSpawningOutputstackpolyTSCplottune_compswrite_fwf4

Dependencies:askpassbase64encbslibcachemclicodacodetoolscolorspacecorpcorcpp11curldigestdplyrevaluatefansifarverfastmapfontawesomeforcatsfsfurrrfuturegenericsggplot2ghgitcredsglobalsgluegridExtragtablehighrhtmltoolshttr2iniisobandjquerylibjsonlitekableExtraknitrlabelinglatticelifecyclelistenvmagrittrMASSMatrixmemoisemgcvmimemunsellnlmeopensslparallellypillarpkgconfigpurrrR6rappdirsRColorBrewerrlangrmarkdownrstudioapisassscalesstringistringrsvglitesyssystemfontstibbletidyrtidyselecttinytexutf8vctrsviridisviridisLitewithrxfunxml2yaml

Example r4ss plots

Rendered fromexample-plots.Rmdusingknitr::rmarkdownon Nov 18 2024.

Last update: 2023-03-28
Started: 2023-03-28

Introduction to r4ss

Rendered fromr4ss-intro-vignette.Rmdusingknitr::rmarkdownon Nov 18 2024.

Last update: 2024-09-19
Started: 2018-01-11

Readme and manuals

Help Manual

Help pageTopics
Add header comments to the input filesadd_file_header
Add legend to plotsadd_legend
Create a bubble plot.bubble3
Calculate variance adjustments for discard or mean body weight datacalc_var_adjust
Find location of executable within path or specified directorycheck_exe
Check input argument 'inputlist'check_inputlist
Copy a the Stock Synthesis input files from one directory to anothercopy_SS_inputs
Deprecated function to make plots from Andre Punt's Rebuilder program.DoProjectPlots
Download SS3 test modelsdownload_models
Rename key Stock Synthesis output files by adding integer valuefile_increment
Get default vector of colors for each areaget_areacols
Collect comments lines starting from "#C" in datfile, ctlfile, starter.ss, forecast.ss etcget_comments
Get the name of the data .ss_new file in a directoryget_dat_new_name
Get the highest phase used in the control fileget_last_phase
Get the name of the .par file in a directoryget_par_name
Gather information for the NOAA Species Information System (SIS)get_SIS_info
Download the Stock Synthesis (SS3) executableget_ss3_exe
Get the tuning tableget_tuning_table
Get time varying parameter labelsget_tv_parlabs
Read admodel.hes filegetADMBHessian
Utility function to test if x is "numerically" integer wrt machine epsilon taken from example section of help of is.integeris.wholenumber
Execute a single jittered model runiterate_jitter
Iteratively run Stock Synthesis with jittered starting valuesjitter
Create multi-figure plots.make_multifig
Create multi-figure sex ratio plots.make_multifig_sexratio
Summarize nuisance MCMC outputmcmc.nuisance
Summarize, analyze and plot key MCMC output.mcmc.out
Make shaded polygons with a mountain-like appearancemountains
Perform SS implementation of Laplace ApproximationNegLogInt_Fn
Make plot of likelihood contributions by fleetPinerPlot
Plot points with confidence intervals.plotCI
Populate multiple Stock Synthesis folders with input filespopulate_multiple_folders
Run a likelihood profile in Stock Synthesis.profile
Read ADMB .par and .cor files.read.admbFit
Run a retrospective analysesretro
Make a vector of colors.rich.colors.short
Run a Stock Synthesis modelrun
Open png device and return info on the file being createdsave_png
Launch a shiny app that displays various selectivity curvesselShapes
Change parameters, bounds, or phases in the control file.SS_changepars
Extract total catch, spawning output, and fraction unfished from forecast yearsSS_decision_table_stuff
Deprecated function to run a retrospective analyses, renamed to retro()SS_doRetro
Estimate bias adjustment for recruitment deviatesSS_fitbiasramp
Create table of fixed forecast catchesSS_ForeCatch
Create HTML files to view figures in browser.SS_html
Make html diagnostic tablesSS_makeHTMLdiagnostictable
A function to create a list object for the output from Stock SynthesisSS_output
Get parameter lines from Stock Synthesis control fileSS_parlines
plot many quantities related to output from Stock SynthesisSS_plots
Deprecated function to run a likelihood profile, renamed to profile().SS_profile
Read all Stock Synthesis input files for a modelSS_read
read ss_summary fileSS_read_summary
Read control file from SSSS_readctl
Deprecated: read control file from SS version 3.24SS_readctl_3.24
read control file from SS version 3.30SS_readctl_3.30
read Stock Synthesis data fileSS_readdat
Deprecated: read data file from SS version 2.00SS_readdat_2.00
Deprecate: read data file from SS version 3.00SS_readdat_3.00
Deprecated: read data file from SS version 3.24SS_readdat_3.24
read data file from SS version 3.30SS_readdat_3.30
read forecast fileSS_readforecast
Deprecated: read ss.par file from SS version 3.24SS_readpar_3.24
read .par file from SS version 3.30SS_readpar_3.30
Read Stock Synthesis starter file as a listSS_readstarter
Read in a weight-at-age data file as a data frameSS_readwtatage
Insert a vector of recruitment deviations into the control file.SS_recdevs
Deprecated function to run jitters, renamed to jitter()SS_RunJitter
Create relative sensitivity plots as described in Cope and Gertseva (2020)SS_Sensi_plot
Deprecated function to tune composition data, renamed to tune_comps()SS_tune_comps
Modify variance and sample size adjustments in the control fileSS_varadjust
Write all Stock Synthesis input files for a modelSS_write
Write Stock Synthesis control fileSS_writectl
Deprecated: write 3.24 control fileSS_writectl_3.24
write control file for SS3 version 3.30SS_writectl_3.30
write Stock Synthesis data fileSS_writedat
Deprecated: write data file for SS version 3.24SS_writedat_3.24
write data file for SS version 3.30SS_writedat_3.30
write forecast fileSS_writeforecast
Deprecated: write ss.par file from SS version 3.24SS_writepar_3.24
write .par file from SS version 3.30SS_writepar_3.30
write starter fileSS_writestarter
Write weight-at-age fileSS_writewtatage
A function to create a table of biology for assessment reporting: length, weight, % mature, fecundity, and selectivitySSbiologytables
Convert Time-StepsSSdiagsTime2Year
Create executive summary tables from an SS3 Report.sso fileSSexecutivesummary
Read MCMC output.SSgetMCMC
Get output from multiple Stock Synthesis models.SSgetoutput
Convert a matrix of natural mortality values into inputs for Stock SynthesisSSmakeMmatrix
Apply Francis composition weighting method TA1.8 for conditional age-at-length fitsSSMethod.Cond.TA1.8
Apply Francis composition weighting method TA1.8SSMethod.TA1.8
Calculate Mohn's rho values for select quantitiesSSmohnsrho
Allow Multi-Plots Set the par() to options suitable for ss3diags multi plots.sspar
Plot matrix of either length or observed age at true ageSSplotAgeMatrix
Plot biology related quantities.SSplotBiology
Plot catch related quantities.SSplotCatch
Plot cumulative catch by cohort.SSplotCohortCatch
plot model comparisonsSSplotComparisons
Plot composition data and fits.SSplotComps
Timeline of presence/absence of data by type, year, and fleet.SSplotData
Plot fit to discard fraction.SSplotDiscard
Plot Dynamic B0SSplotDynamicB0
Plot indices of abundance and associated quantities.SSplotIndices
Plot uncertainty around chosen selectivity ogive from MCMC.SSplotMCMC_ExtraSelex
Plot mean weight data and fits.SSplotMnwt
Show movement rates on a map.SSplotMovementMap
Plot movement rates from model outputSSplotMovementRates
Plot numbers-at-age related data and fits.SSplotNumbers
Plot distributions of priors, posteriors, and estimates.SSplotPars
Plot likelihood profile resultsSSplotProfile
Plot recruitment deviationsSSplotRecdevs
Plot of recruitment distribution among areas and seasonsSSplotRecdist
Make squid plot of retrospectives of recruitment deviations.SSplotRetroRecruits
Plot selectivitySSplotSelex
Plot sex-ratio data and fits for two sex modelsSSplotSexRatio
Plot spawner-recruit curve.SSplotSpawnrecruit
Plot Spawning Potential Ratio (SPR) quantities.SSplotSPR
Plot the summary F (or harvest rate).SSplotSummaryF
Plot tagging data and fitsSSplotTags
Plot timeseries dataSSplotTimeseries
Plot yield and surplus production.SSplotYield
Summarize the output from multiple Stock Synthesis models.SSsummarize
make table comparing quantities across modelsSStableComparisons
Plot unavailable spawning outputSSunavailableSpawningOutput
modified from "stackpoly" by Jim Lemon from "plotrix" packagestackpoly
Use 3.30 q options to create the 3.24 q setuptranslate_3.30_to_3.24_Q_setup
Use 3.30 variance adjustments to create the 3.24 formattingtranslate_3.30_to_3.24_var_adjust
Create a plot for the TSC reportTSCplot
Calculate new tunings for length and age compositions and (re)run modelstune_comps
Function to write formatted table similar to table written by gdata::write.fwf from data.frame or matrix This function does not accept columns or logical with factorwrite_fwf4
Add a comment line to the input fileswriteComment