Create the rda package for a plot or table

create_rda(
  object,
  topic_label,
  fig_or_table,
  dat,
  dir = getwd(),
  year = format(as.POSIXct(Sys.Date(), format = "%YYYY-%mm-%dd"), "%Y"),
  ref_line = "msy",
  scale_amount = 1,
  unit_label = "mt",
  table_df = NULL
)

Arguments

object

Object. Table or plot object

topic_label

String. Name of the object

fig_or_table

String. Indicates whether the object is a "table" or "figure"

dat

Data frame. Data which will fill in captions and alternative text for the object

dir

Path. Directory to where the rda will be saved

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

year

Number. Assessment year

Default: the current year

ref_line

String. Reference line value

Default: "msy"

Options: Including, but not limited to: "msy", "target", "unfished"

scale_amount

Number. A number describing how much to scale down the quantities shown on the y axis. For example, scale_amount = 100 would scale down a value from 500,000 –> 5,000. This scale will be reflected in the y axis label.

Default: 1

unit_label

String. Unit label for the y-axis

Default: "mt"

table_df

Data frame. The data frame that the table will be made into for purposes of exporting a latex formatted table.

Value

An rda package for a plot or table object. Requires an object from the R environment such as a ggplot or flextable object.

See also

[export_rda()], [extract_caps_alttext()]

Examples

if (FALSE) { # \dontrun{
create_rda(
  object = my_plot,
  topic_label = "my_plot",
  fig_or_table = "figure",
  dat = my_data,
  dir = "path/to/save"
)
} # }