make_abbrev_footnote | R Documentation |
This higher order function can be used to generate functions to produce strings that are suitable for use as footnotes in tables (or figures) that contain abbreviations. By convention, it is required that all abbreviations appearing in a table or figure be spelled out in full in a footnote.
make_abbrev_footnote(abbrevs, sort = TRUE, sep = "; ", end = ".")
abbrevs |
Either a named |
sort |
Should the abbreviations be automatically sorted? |
sep |
The seperator to use between abbreviations. |
end |
Punctuation to appear at the end of the footnote. |
If an abbreviation is not found in the list, the function will generate a warning, and produce a strange HTML code that renders as a red on yellow "XXX" in the browser (to draw attention to the issue).
A function that takes any number of arguments, each argument being an abbreviation to include. This function, when called, will generate the footnote string.
abbrevs <- list( ALP = "alkaline phosphatase", ALT = "alanine aminotransferase", AST = "aspartate aminotransferase", BMI = "body mass index", BSA = "body surface area") abbrev_footnote <- make_abbrev_footnote(abbrevs) abbrev_footnote("BMI", "ALP", "ALT") ## Not run: abbrev_footnote("BMI", "XXX", "YYY") # Generates a warning ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.