Index of abundance table

table_index(
  dat,
  era = NULL,
  interactive = TRUE,
  group = NULL,
  method = "sum",
  module = NULL,
  label = NULL,
  digits = 2,
  make_rda = FALSE,
  tables_dir = getwd()
)

Arguments

dat

A tibble or named list of tibbles (input as `list()`) returned from convert_output.

If inputting a list of tibbles, the first tibble's reference point defined in `ref_line` is used to plot a reference line or calculate relative spawning biomass.

era

A string naming the era of data.

Default: "time"

Options: "early", "time", "fore" (forecast), or NULL (all data)

interactive

A logical value indicating if the environment is interactive.

Default: `FALSE`

group

A string of a single column that groups the data.

Set group = "none" to summarize data over all indexing values.

Default: NULL Options: Including, but not limited to: "year", "area", "fleet", "sex", "none", NULL

method

A string describing the method of summarizing data when group is set to "none".

Default: "sum"

Options: "sum" or "mean"

module

(Optional) A string indicating the module_name found in `dat`. If selecting >1 module, place them in a vector like c("module1", "module2").

Default: NULL

If the interactive and >1 module_name is found, user will select the module_name in the console. @seealso [filter_data()]

label

The label that will be chosen from the input file. If unspecified, the function will search the "label" column and use the first matching label in this ordered list: "index_weight", "index_numbers", "index_expected", "index_predicted", "index".

Default: NULL

digits

Numeric value indicating the number of digits values in the table will be rounded to.

Default: 2

make_rda

A logical value indicating whether to save the object and make an automated caption and alternative text in the form of an `rda` object. If TRUE, the rda will be exported to the folder indicated in the argument "figures_dir".

Default: `FALSE`.

tables_dir

The location of the folder containing the generated table rda files ("tables") that will be created if the argument `make_rda` = TRUE.

Default: the working directory (`getwd()`)

Value

A table of observed annual index of abundance plus error, stratified by fleet.

Details

The input is from an assessment model output file translated to a standardized output (convert_output). There are options to return a [gt::gt()] object or export an rda object containing a gt-based table, caption, and LaTeX-based table.

See also

[convert_output()], [filter_data()], [process_table()], [export_kqs()], [insert_kqs()], [create_rda()]

Examples

if (FALSE) { # \dontrun{
table_index(dat)

table_index(
  dat,
  make_rda = TRUE,
  tables_dir = getwd()
)
} # }