# R Code for Stock Synthesis

## Documentation for package ‘r4ss’ version 1.44.0

- DESCRIPTION file
- Package NEWS
- Package README

## Help Pages

A B C D F G I M N P R S T W

## -- A --

add_legend | Add legend to plots

## -- B --

bubble3 | Create a bubble plot.

## -- C --

check_inputlist | Check input argument 'inputlist'
check_model | Check input argument 'model'
copy_SS_inputs | Copy a the Stock Synthesis input files from one directory to another

## -- D --

DoProjectPlots | Make plots from Rebuilder program

## -- F --

file_increment | Rename Stock Synthesis files by adding integer value

## -- G --

getADMBHessian | Read admodel.hes file
get_comments | Collect comments lines starting from "#C" in datfile, ctlfile, starter.ss, forecast.ss etc
get_dat_new_name | Get the name of the data .ss_new file in a directory
get_last_phase | Get the highest phase used in the control file
get_SIS_info | Gather information for the NOAA Species Information System (SIS)
get_tuning_table | Get the tuning table
get_tv_parlabs | Get time varying parameter labels

## -- I --

is.wholenumber | Utility function to test if x is "numerically" integer wrt machine epsilon taken from example section of help of is.integer

## -- M --

make_multifig | Create multi-figure plots.
make_multifig_sexratio | Create multi-figure sex ratio plots.
mcmc.nuisance | Summarize nuisance MCMC output
mcmc.out | Summarize, analyze and plot key MCMC output.
mountains | Make shaded polygons with a mountain-like appearance

## -- N --

NegLogInt_Fn | Perform SS implementation of Laplace Approximation

## -- P --

PinerPlot | Make plot of likelihood contributions by fleet
plotCI | Plot points with confidence intervals.
populate_multiple_folders | Populate multiple Stock Synthesis folders with input files

## -- R --

r4ss_logo | Make a simple logo for r4ss organization on GitHub
read.admbFit | Read ADMB .par and .cor files.
rich.colors.short | Make a vector of colors.
run_SS_models | Run multiple Stock Synthesis models

## -- S --

save_png | Open png device and return info on the file being created
selShapes | Launch a shiny app that displays various selectivity curves
SSbiologytables | A function to create a table of biology for assessment reporting: length, weight, % mature, fecundity, and selectivity
SSbootstrap | Fit models to parametric bootstraps
SSdiagsTime2Year | Convert Time-Steps
SSexecutivesummary | A function to create a executive summary tables from an SS Report.sso file
SSgetMCMC | Read MCMC output.
SSgetoutput | Get output from multiple Stock Synthesis models.
SSmakeMmatrix | Convert a matrix of natural mortality values into inputs for Stock Synthesis
SSMethod.Cond.TA1.8 | Apply Francis composition weighting method TA1.8 for conditional age-at-length fits
SSMethod.TA1.8 | Apply Francis composition weighting method TA1.8
SSmohnsrho | Calculate Mohn's Rho values for select quantities
sspar | Allow Multi-Plots Set the par() to options suitable for ss3diags multi plots.
SSplotAgeMatrix | Plot matrix of either length or observed age at true age
SSplotBiology | Plot biology related quantities.
SSplotCatch | Plot catch related quantities.
SSplotCohortCatch | Plot cumulative catch by cohort.
SSplotComparisons | plot model comparisons
SSplotComps | Plot composition data and fits.
SSplotData | Timeline of presence/absence of data by type, year, and fleet.
SSplotDiscard | Plot fit to discard fraction.
SSplotDynamicB0 | Plot Dynamic B0
SSplotIndices | Plot indices of abundance and associated quantities.
SSplotMCMC_ExtraSelex | Plot uncertainty around chosen selectivity ogive from MCMC.
SSplotMnwt | Plot mean weight data and fits.
SSplotMovementMap | Show movement rates on a map.
SSplotMovementRates | Plot movement rates from model output
SSplotNumbers | Plot numbers-at-age related data and fits.
SSplotPars | Plot distributions of priors, posteriors, and estimates.
SSplotProfile | Plot likelihood profile results
SSplotRecdevs | Plot recruitment deviations
SSplotRecdist | Plot of recruitment distribution among areas and seasons
SSplotRetroRecruits | Make squid plot of retrospectives of recruitment deviations.
SSplotSelex | Plot selectivity
SSplotSexRatio | Plot sex-ratio data and fits for two sex models
SSplotSpawnrecruit | Plot spawner-recruit curve.
SSplotSPR | Plot Spawning Potential Ratio (SPR) quantities.
SSplotSummaryF | Plot the summary F (or harvest rate).
SSplotTags | Plot tagging data and fits
SSplotTimeseries | Plot timeseries data
SSplotYield | Plot yield and surplus production.
SSsummarize | Summarize the output from multiple Stock Synthesis models.
SStableComparisons | make table comparing quantities across models
SSunavailableSpawningOutput | Plot unavailable spawning output
SS_changepars | Change parameters, bounds, or phases in the control file.
SS_decision_table_stuff | Extract total catch, spawning output, and fraction unfished from forecast years
SS_doRetro | Run retrospective analyses
SS_fitbiasramp | Estimate bias adjustment for recruitment deviates
SS_ForeCatch | Create table of fixed forecast catches
SS_html | Create HTML files to view figures in browser.
SS_makeHTMLdiagnostictable | Make html diagnostic tables
SS_output | A function to create a list object for the output from Stock Synthesis
SS_parlines | Get parameter lines from Stock Synthesis control file
SS_plots | plot many quantities related to output from Stock Synthesis
SS_profile | Run a likelihood profile in Stock Synthesis.
SS_read | Read all Stock Synthesis input files for a model
SS_readctl | Read control file from SS
SS_readctl_3.24 | read control file from SS version 3.24
SS_readctl_3.30 | read control file from SS version 3.30
SS_readdat | read Stock Synthesis data file
SS_readdat_2.00 | read data file from SS version 2.00
SS_readdat_3.00 | read data file from SS version 3.00
SS_readdat_3.24 | read data file from SS version 3.24
SS_readdat_3.30 | read data file from SS version 3.30
SS_readforecast | read forecast file
SS_readpar_3.24 | read ss.par file from SS version 3.24
SS_readpar_3.30 | read ss.par file from SS version 3.30
SS_readstarter | read starter file
SS_readwtatage | Read weight-at-age data file
SS_read_summary | read ss_summary file
SS_recdevs | Insert a vector of recruitment deviations into the control file.
SS_RunJitter | Iteratively apply the jitter option in SS
SS_Sensi_plot | Create relative sensitivity plots as described in Cope and Gertseva (2020)
SS_splitdat | Split apart bootstrap data to make input file.
SS_tune_comps | Calculate new tunings for length and age compositions and (re)run models
SS_varadjust | Modify variance and sample size adjustments in the control file
SS_write | Write all Stock Synthesis input files for a model
SS_writectl | Write Stock Synthesis control file
SS_writectl_3.24 | write control file
SS_writectl_3.30 | write control file for SS version 3.30
SS_writedat | write Stock Synthesis data file
SS_writedat_3.24 | write data file for SS version 3.24
SS_writedat_3.30 | write data file for SS version 3.30
SS_writeforecast | write forecast file
SS_writepar_3.24 | write ss.par file from SS version 3.24
SS_writepar_3.30 | write ss.par file from SS version 3.30
SS_writestarter | write starter file
SS_writewtatage | Write weight-at-age file
stackpoly | modified from "stackpoly" by Jim Lemon from "plotrix" package

## -- T --

translate_3.30_to_3.24_Q_setup | Use 3.30 q options to create the 3.24 q setup
translate_3.30_to_3.24_var_adjust | Use 3.30 variance adjustments to create the 3.24 formatting
TSCplot | Create a plot for the TSC report

## -- W --

write_fwf4 | 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 factor