Rather than reading from a file, glossary objects can be created inline.

as_glossary(...)

Arguments

...

unquoted <label> = <definition> pairs, or a named list of abbreviations where the names are the labels; see Examples.

Value

A new glossary object.

Details

For all entries in the new object, the abbreviation is set to the label. See update_abbrev() to customize the abbreviation.

Entries that have duplicate labels will be dropped with a warning.

Examples


as_glossary(wt = "weight", ht = "height", bmi = "body mass index")
#> wt  : weight
#> ht  : height
#> bmi : body mass index

as_glossary(wt = "weight", ht = "height", wt = "baseline weight")
#> Warning: Dropping duplicate glossary labels:
#>  wt: baseline weight
#> wt : weight
#> ht : height

l <- list(VPC = "visual predictive check", tz = "timezone")

as_glossary(l)
#> VPC : visual predictive check
#> tz  : timezone

as_glossary(l, wt = "weight")
#> VPC : visual predictive check
#> tz  : timezone
#> wt  : weight