Export a figure/table, and its caption and alternative text, to an rda object. Typically used after satf::extract_caps_alttext().

export_rda(
  final = NULL,
  caps_alttext = NULL,
  rda_dir = NULL,
  topic_label = NULL,
  fig_or_table = NULL
)

Arguments

final

The final figure (ggplot) or table (flextable) object.

caps_alttext

The object containing a figure's caption and alternative text, in a list, or a table's caption, likely generated with satf::extract_caps_alttext().

rda_dir

If the user has already created a folder containing .rda files with figures, tables, alt text, and captions, rda_dir represents the location of the folder containing these .rda files ("rda_files"). Otherwise, an "rda_files" folder will be created automatically, then used to store the exported rda files.

topic_label

A string that describes a figure or table's label. These labels are found in the "label" column of the "captions_alt_text.csv" file and are used to link the figure or table with its caption/alt text.

fig_or_table

A string describing whether the plot is a figure or table.

Value

An rda file with a figure's ggplot, caption, and alternative text, or a table's flextable and caption.

Examples

if (FALSE) { # \dontrun{
export_rda(final = final_table_object,
caps_alttext = caps_alttext_object,
rda_dir = here::here(),
topic_label = "bnc",
fig_or_table = "table")

export_rda(final = final_figure_object,
caps_alttext = another_caps_alttext_object,
rda_dir = "my_rda_dir",
topic_label = "landings",
fig_or_table = "figure")
} # }