Allow user to define ggplot labels, and populate missing values from the defaults specified in labels formal argument.

matchLabels(labels, choices)

Arguments

labels

list. User-defined plot labels.

choices

list. Default plot labels, defined in labels formals().

Note

Attempting to follow a similar naming convention to match.arg() here, using choices argument.

Updated 2019-09-16.

See also

Examples

matchLabels( labels = list(title = "XXX"), choices = list( title = "AAA", subtitle = "BBB" ) )
#> $title #> [1] "XXX" #> #> $subtitle #> [1] "BBB" #>