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",
  ref_point = "msy",
  scale_amount = 1,
  unit_label = "mt"
)

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

year

Default to current year

ref_line

Reference line value such as "msy", "target" or "unfished"

ref_point

Reference point value such as "msy", "target" or "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.

unit_label

A string containing a unit label for the y-axis

Value

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

Examples

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