table_decision: Create the Executive Summary decision tables. 'rows_to_label'...

table_decisionR Documentation

Create the Executive Summary decision tables. rows_to_label and row_labels need changing each year.

Description

Create the Executive Summary decision tables. rows_to_label and row_labels need changing each year.

Usage

table_decision(
  model,
  type = c("biomass", "spr"),
  forecast_inds = seq_along(model$forecasts[[length(model$forecasts)]]),
  rows_to_show = NULL,
  letter_df = tribble(~let, ~row1_text, ~row2_text, "a", "", "", "b", "", "", "c", "",
    "", "d", "10\\% reduction", "each year", "e", paste0(model$endyr, " catch"), "",
    "f", "", "", "g", "10\\% reduction", "each year", "h", "", "", "i",
    "10\\% reduction", "each year", "j", "", "", "k", paste0(model$endyr - 1, " TAC"),
    "", "l", paste0(model$endyr, " TAC"), "", "m", "Fishing intensity", "at 100\\%",
    "n", "Default HR", paste0("(", fspr_40_10_for_latex_table, ")"), "o", "Equal catch",
    paste0("($\\mathrm{C}_{", model$endyr + 
     1, "} \\approxeq \\mathrm{C}",
    "_{", model$endyr + 2, "}$)")),
  bold_letters = TRUE,
  digits = 2,
  left_col_cm = 1,
  right_cols_cm = 1,
  font_size = 10,
  header_font_size = 10,
  header_vert_spacing = 12,
  header_vert_scale = 1.2,
  ...
)

Arguments

model

A model, created by create_rds_file()

type

One of biomass or spr

forecast_inds

The indices to use in the forecasts object which itself is an object of the model list

rows_to_show

A vector of letters of rows to show. If NULL, show all rows

letter_df

A data frame with three columns called let, row1_text, and row2_text where let contains the letter shown in the table for each row, row1_text is the first line of text directly beneath the letter, and row2_text is the second line of text directly below the first line of text. row1_text and row2_text can be empty strings, in that case no text will be shown in the cell, only the letter

bold_letters

Logical. If TRUE, the letters labelling each row will be boldface

digits

The number of decimal points to show in the table

left_col_cm

Number of centimeters wide to make the leftmost column. This needs to be changed when the font size is changed

right_cols_cm

Number of centimeters wide to make the 3 rightmost columns wide. This needs to be changed when the font size is changed

font_size

The table data and header font size in points

header_font_size

The font size for the headers only. If NULL, the headers will have the same font size as the table cell data

header_vert_scale

Scale factor to create the vertical spacing value. See header_vert_spacing

...

Arguments passed to knitr::kable()

vert_spacing

The vertical spacing between newlines for this font. If NULL this will be calculated as header_font_size * header_vert_scale

Value

An knitr::kable() object


pacific-hake/hake-assessment documentation built on Jan. 14, 2025, 9:12 p.m.