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

Table or plot object

topic_label

A string that names the object

fig_or_table

A string identifying if the object is a "table" or "figure"

dat

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

dir

Directory to where the rda will be saved

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

year

Assessment year

Default: the current year

ref_line

Reference line value

Default: "msy"

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

scale_amount

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

A string containing a unit label for the y-axis

Default: "mt"

table_df

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"
)
} # }