Format a text string that was used to label a figure or a table such that you can reference that figure or table elsewhere in a report. For example the label might be fig:my-best-figure and in the text you might want Look at the beautiful pie chart in my best figure ever (Figure \ref{fig:mybest-figure}).

report_ref_label(x)

Arguments

x

A vector of strings. The strings should be valid figure or table labels. For example x = c("fig:apple", "fig:banana").

See also

Author

Kelli F. Johnson

Examples

# Generate some figure references
report_ref_label("fig:apple")
#> Figure \@ref(fig:apple)
report_ref_label(c("fig:apple", "fig:banana"))
#> Figures \@ref(fig:apple)--\@ref(fig:banana)
report_ref_label(c("fig:apple", "fig:banana", "fig:carrot"))
#> Figures \@ref(fig:apple)--\@ref(fig:carrot)
# Works for tables too
report_ref_label("tab:apple")
#> Table \@ref(tab:apple)