| Title: | Namibian Hake Stock Assessment Model |
|---|---|
| Description: | Runs, validates, summarizes, and reports results from the age-structured ADMB assessment model for Namibian hake. |
| Authors: | Jim Ianelli [aut, cre], John Kathena [aut] |
| Maintainer: | Jim Ianelli <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-07-23 20:46:17 UTC |
| Source: | https://github.com/jimianelli/NamibianHake |
This function creates a plot of selectivity across years and ages.
plot_sel( Year = M$Year, sel = M[, 2:10], styr = 1964, fage = NULL, lage = NULL, alpha = 0.2, scale = 3.8, fill = "purple" )plot_sel( Year = M$Year, sel = M[, 2:10], styr = 1964, fage = NULL, lage = NULL, alpha = 0.2, scale = 3.8, fill = "purple" )
Year |
A vector of years. Default is |
sel |
A matrix of selectivity values. Default is |
styr |
An integer specifying the start year for the plot. Default is 1964. |
fage |
An integer specifying the first age to include in the plot. Default is NULL. |
lage |
An integer specifying the last age to include in the plot. Default is NULL. |
alpha |
A numeric value specifying the transparency level of the fill. Default is 0.2. |
scale |
A numeric value specifying the scale for the density ridges. Default is 3.8. |
fill |
A character string specifying the fill color for the density ridges. Default is "purple". |
A ggplot object showing selectivity across years and ages.
## Not run: plot_sel(Year = M$Year, sel = M[, 2:10], styr = 1970, fage = 1, lage = 8) ## End(Not run)## Not run: plot_sel(Year = M$Year, sel = M[, 2:10], styr = 1970, fage = 1, lage = 8) ## End(Not run)
This function creates a plot comparing observed and predicted age compositions for a specified type.
PlotAgeFit(x = bc, title = NULL, type = "fishery", fage = 2, lage = 7)PlotAgeFit(x = bc, title = NULL, type = "fishery", fage = 2, lage = 7)
x |
A list containing the observed and predicted age compositions. Default is |
title |
A character string for the plot title. Default is NULL. |
type |
A character string specifying the type of composition to plot. Default is "fishery". |
fage |
An integer specifying the first age to include in the plot. Default is 2. |
lage |
An integer specifying the last age to include in the plot. Default is 7. |
A ggplot object comparing observed and predicted age compositions.
## Not run: PlotAgeFit(x = bc, title = "Age Composition", type = "survey", fage = 1, lage = 8) ## End(Not run)## Not run: PlotAgeFit(x = bc, title = "Age Composition", type = "survey", fage = 1, lage = 8) ## End(Not run)
Read ADMB output files .rep, .par, and .cor and return an R object of type 'list'
read_admb(repfile)read_admb(repfile)
repfile |
ADMB output files to be read (no extension needed) |
object of type 'list' with ADMB outputs as list elements
Steve Martell, Anders Nielsen, Athol Whitten, D'Arcy N. Webber
Read ADMB .ctl file and return an R object of type 'list'. DOES NOT WORK
read_ctl(fn)read_ctl(fn)
repfile |
name of ADMB output file to be read |
object of type 'list' with ADMB outputs therein
D'Arcy N. Webber
Read ADMB .par, .std, and .cor file and return an R object of type 'list' of estimates and correlations
read_fit(repfile)read_fit(repfile)
repfile |
name of ADMB output file to be read (no extension needed) |
object of type 'list' with ADMB outputs therein
Steve Martell, Anders Nielsen, Athol Whitten, D'Arcy N. Webber
Read ADMB .psv file and return an R object of type 'list'
read_psv(fn, nsamples = 10000)read_psv(fn, nsamples = 10000)
repfile |
name of ADMB output file to be read (no extension needed) |
object of type 'list' with ADMB outputs therein
Steve Martell
Read output file from the random effects (RE) model into a data.frame
read_re_output(file = "rwout.rep", skip_data = FALSE, use_names = FALSE)read_re_output(file = "rwout.rep", skip_data = FALSE, use_names = FALSE)
file |
A character string of the file to be read in, defaulting to 'rwout.rep' in the current working directory. |
skip_data |
Whether to skip returning columns representing the data inputs. If TRUE these are included and will have NA values for any missing years |
use_names |
Whether to use the names written by the RE model or to use more meaningful ones (default) |
A dataframe with columns named based on the tags in the output file
Read ADMB .rep file and return an R object of type 'list'
read_rep(fn)read_rep(fn)
fn |
name of ADMB output file to be read (no extension needed) |
object of type "list" with ADMB outputs therein
Steve Martell, D'Arcy N. Webber
Test the RE on a single species. This compares a current ADMB univariate run to a previous run. It tests continuity not correctness
test_re_species(d, test_tmb = TRUE)test_re_species(d, test_tmb = TRUE)
d |
The .dat file name, e.g., bigskate_t.dat, found in tests/data folder |
It will throw an error if the results have changed, otherwise results are consistent.
A data.frame with ADMB and TMB estimates for comparing
Write an input file for the RE model
write_re_input( file, years, biomass, CV, tag = NULL, sp = "species", survey = "survey", yr_start = NULL, yr_end = NULL )write_re_input( file, years, biomass, CV, tag = NULL, sp = "species", survey = "survey", yr_start = NULL, yr_end = NULL )
file |
A path to the output file, usually ending in .dat |
years |
A vector of years for the observations |
biomass |
A vector of biomasses for the observations |
CV |
A vector of CV values for the observations |
tag |
Optional character string to print to file for bookkeeping (e.g., "EBS shelf flathead sole") |
yr_start |
Optional start year for predictions |
yr_end |
Optional end year for predictions |
Nothing, a data file is written to file
read_re_output