Package 'WtAgeRe'

Title: Fish Body Mass at Age Estimation
Description: A random effects model for estimating variance in weight-at-age, with utilities to read ADMB outputs and plot weight-at-age anomalies.
Authors: Jim Ianelli [aut, cre]
Maintainer: Jim Ianelli <[email protected]>
License: CC0-1.0
Version: 0.1.0
Built: 2026-05-31 06:01:11 UTC
Source: https://github.com/afsc-assessments/WtAgeRe

Help Index


Transparent colors

Description

Transparent colors

Usage

colr(col.pal = 1, a = 1)

Arguments

col.pal

Color palette or vector of colors.

a

Numeric alpha in [0, 1].

Value

Character vector of colors with alpha applied.

Note

Author: Nathan Stephens (hacks package)


Get predicted weight-at-age

Description

Read ADMB output and return predicted weight-at-age by year.

Usage

fn_get_pred(file = c("wt"), dat = NULL, source = c("model"), age_range = NULL)

Arguments

file

Character vector of base filenames (no extension). Default is "wt".

dat

Optional data list used to infer age range (indices 8 and 9).

source

Character vector of model labels for each file.

age_range

Optional numeric vector of ages to use as column names.

Value

A data frame with year, age columns, and a source column.


Plot weight-at-age anomalies

Description

Plot weight-at-age anomalies

Usage

fn_plot_anoms(dfin, maxage = 10, firstyr = 1982, minage = 3, txtsize = 3)

Arguments

dfin

Data frame output from fn_get_pred().

maxage

Maximum age to plot.

firstyr

First year to include.

minage

Minimum age to plot.

txtsize

Text label size.

Value

A ggplot object.


Read ADMB output files

Description

Read ADMB output files .rep, .par, and .cor and return an R object of type 'list'

Usage

read_admb(repfile)

Arguments

repfile

ADMB output files to be read (no extension needed)

Value

object of type 'list' with ADMB outputs as list elements

Author(s)

Steve Martell, Anders Nielsen, Athol Whitten, D'Arcy N. Webber


Read ADMB .ctl file

Description

Read ADMB .ctl file and return an R object of type 'list'. DOES NOT WORK

Usage

read_ctl(fn)

Arguments

repfile

name of ADMB output file to be read

Value

object of type 'list' with ADMB outputs therein

Author(s)

D'Arcy N. Webber


Read ADMB data files

Description

Read ADMB data files

Usage

read_dat(datfile)

Arguments

repfile

ADMB output files to be read (no extension needed)

Value

object of type 'list' with ADMB outputs as list elements

Author(s)

Steve Martell, Anders Nielsen, Athol Whitten, D'Arcy N. Webber


Read ADMB .par, .std, and .cor file and return an R object of type 'list' of estimates and correlations

Description

Read ADMB .par, .std, and .cor file and return an R object of type 'list' of estimates and correlations

Usage

read_fit(repfile)

Arguments

repfile

name of ADMB output file to be read (no extension needed)

Value

object of type 'list' with ADMB outputs therein

Author(s)

Steve Martell, Anders Nielsen, Athol Whitten, D'Arcy N. Webber


Read ADMB .psv file

Description

Read ADMB .psv file and return an R object of type 'list'

Usage

read_psv(fn, nsamples = 10000)

Arguments

repfile

name of ADMB output file to be read (no extension needed)

Value

object of type 'list' with ADMB outputs therein

Author(s)

Steve Martell


Read ADMB .rep file

Description

Read ADMB .rep file and return an R object of type 'list'

Usage

read_rep(fn)

Arguments

fn

name of ADMB output file to be read (no extension needed)

Value

object of type "list" with ADMB outputs therein

Author(s)

Steve Martell, D'Arcy N. Webber


Replace outliers with mean for mean weight-at-age

Description

Replace outliers with mean for mean weight-at-age

Usage

replace_zeros_with_mean(column)

Arguments

column

Numeric vector.

Value

Numeric vector with outliers replaced by the mean of non-zero values.


Replace zeros with near-two for SD

Description

Replace zeros with near-two for SD

Usage

replace_zeros_with_two(column)

Arguments

column

Numeric vector.

Value

Numeric vector with zeros replaced by 1.9999.


Write ADMB data file

Description

Write ADMB data file

Usage

write_dat(A, datfile)

Arguments

A

List of ADMB objects.

datfile

Output data file path.

Value

Invisibly returns NULL.