table_decision: Format a decision table

View source: R/table_decision.R

table_decisionR Documentation

Format a decision table

Description

Format a decision table for its inclusion in a document.

Usage

table_decision(
  ...,
  years,
  rowgroup = c("Constant", "ACL", "ACL2"),
  colgroup = c("Low", "Base", "High"),
  format = c("latex", "html"),
  caption = formals(kableExtra::kbl)$caption,
  label = formals(kableExtra::kbl)$label
)

Arguments

...

Each element provided in the call to this function that is not assigned to a particular input argument should be a vector of file paths to the models you want to read for a given column of your decision table. For example, if a single column has results from three models and if your decision table has a low and high state of nature, then there should be two vectors passed via ... and each vector would contain paths to three different models. The order of the vectors will be the column order from left to right. The order of the models within a vector will be the row order.

years

A vector of years you want catches for.

rowgroup

A vector of character strings to label the group names in the first column that define the groups across rows. Typically, this information is the catch-stream groups. You can wrap lines if you include the makecell package in your sty file and use kableExtra::linebreak() on this vector, which translates the characters ⁠\n⁠ into something that LaTeX can use.

colgroup

A vector of character strings to label the states of nature.

format

Argument passed to kableExtra::kbl allowing for the switch between "latex" and "html".

caption

A character string that will be passed to the caption parameter of kableExtra::kbl. The default value is NULL.

label

A character string without underscores that will be passed to the label parameter of kableExtra::kbl. The default value is NULL.

Details

todo:

  • get lines below rowgroups, but I think this might be working in LaTeX only.

  • write checks

  • get vertical lines

Author(s)

Ian G. Taylor, Chantel R. Wetzel, Kelli F. Johnson

Examples

table_decision(
  list(mod.2021.n.022.001, mod.2021.n.022.001, mod.2021.n.022.001),
  list(mod.2021.n.022.001, mod.2021.n.022.001),
  list(mod.2021.n.022.001, mod.2021.n.022.001),
  years = 2021:2032
)
table_decision(
  list(mod.2021.n.023.611,mod.2021.n.023.612,mod.2021.n.023.613),
  list(mod.2021.n.023.621,mod.2021.n.023.622,mod.2021.n.023.623),
  list(mod.2021.n.023.631,mod.2021.n.023.632,mod.2021.n.023.633),
  years = 2021:2032
)

iantaylor-NOAA/Lingcod_2021 documentation built on Oct. 30, 2024, 6:42 p.m.