acTable: Return acronyms used dataframe

Description Usage Arguments Details Value Examples

View source: R/acronymr.R

Description

Create an acronym table of acronyms used and insert into text.

Usage

1
acTable(acronyms = "acronyms", altFrm = TRUE, Caption = NULL)

Arguments

acronyms

name of acronym data frame as character string

altFrm

logical indicating whether to use alternate form where available

Caption

acronmy table caption

Details

acTable is most often used within a knitted document. The function checks if an acronyms exists and whether any acronyms were used in the document. If both criteria are true, a dataframe containing the acronym and definition of all acronyms used in the document is returned.

Value

If acronyms are used in the document, a dataframe. If acronyms does not exist or no acronyms were used in the document, a message is raised and returns NULL.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# This example assumes use within an rmarkdown documnet
acronyms <-
  tibble::tribble(
    ~Acronym, ~Alternate, ~Definition,
    "IMO", NA,"In My Opinion",
    "PCR", NA, "Polymerase Chain Reaction",
    "RNA", NA, "Ribonucleic Acid",
    "H2NO3", "H~2~NO~3~", "Nitric Acid")

# Add inclusion flag
acronyms$Include <- FALSE
# Alphabetize acronyms for ease of reading
acronyms <- acronyms[order(acronyms$Acronym),]

# place an acronym inline
ac("IMO")

# generate acronym table
acTable("acronyms")

HJAllen/acronymr documentation built on Dec. 26, 2019, 9:26 a.m.