Adds a new row to an existing captions_alt_text.csv file with a label, type, caption, and alt_text for a figure or table not present in stockplotr.

add_caption_alt_text(
  topic_label,
  fig_or_table,
  caption,
  alt_text = "",
  dir = file.path(getwd(), "captions_alt_text.csv")
)

Arguments

topic_label

String. Figure/table label. For automated matching in asar-based report, it must match the label in your plot's chunk options, MINUS the "fig-" or "tab-". For example, the label "custom_table1" would match up properly with the "tbl-custom_table1" code chunk label.

fig_or_table

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

Options: "figure" or "table"

caption

String. Figure/table caption.

alt_text

String. Figure alternative text. Unnecessary for text-based tables.

Default: ""

dir

Path. Path to the existing captions_alt_text.csv file that will be updated with the new caption and alt text.

Default: file.path(getwd(), "captions_alt_text.csv")

Examples

if (FALSE) { # \dontrun{
add_caption_alt_text(
  topic_label = "my_topic",
  fig_or_table = "figure",
  caption = "My example figure caption.",
  alt_text = "My example figure alt text.",
  dir = file.path(getwd(), "captions_alt_text.csv")
)
} # }