heatmap_add_extrap_yrs_wa: Add extrapolated years before and after the weight-at-age...

View source: R/utils-heatmap-add-extrap-yrs-wa.R

heatmap_add_extrap_yrs_waR Documentation

Add extrapolated years before and after the weight-at-age time series data in model$wtatage

Description

Add extrapolated years before and after the weight-at-age time series data in model$wtatage

Usage

heatmap_add_extrap_yrs_wa(
  model = NULL,
  wa = NULL,
  pre_yrs = min(pull(filter(model$wtatage, Yr > 0), Yr)):model$endyr,
  pre_func = mean,
  post_yrs = min(pull(filter(model$wtatage, Yr > 0), Yr)):model$endyr,
  post_func = mean,
  pre_wa_vals = NULL,
  post_wa_vals = NULL,
  ...
)

Arguments

model

An list of results read in from an SS model using load_ss_files()

wa

The weight-at-age data frame found in model$wtatage

pre_yrs

A vector of the years to use for the pre_func function to fill in missing years before the weight-at-age data starts

pre_func

The function to use on the data filtered by the years given by pre_yrs

post_yrs

A vector of the years to use for the post_func function to fill in missing years after the weight-at-age data ends (projection years)

post_func

The function to use on the data filtered by the years given by post_yrs

pre_wa_vals

A vector of weight-at-age values to use instead of the function pre_func() on the data found in the years defined by pre_yrs. If this is not NULL, this vector will be used for all years prior to the start of the weight-at-age data instead of the output of pre_func(). Note this starts at age 0, so it may be one more than you think

post_wa_vals

A vector of weight-at-age values to use instead of the function post_func() on the data found in the years defined by post_yrs. If this is not NULL, this vector will be used for all projection years instead of the output of post_func() Note this starts at age 0, so it may be one more than you think

...

Absorbs arguments meant for other functions

Value

A data frame containing years (yr) column and columns for age, represented as numbers (no text appended to them). The number of age columns is the same as the number in model$wtatage


pacific-hake/hake-assessment documentation built on Nov. 8, 2024, 1:16 p.m.