Allow user to define ggplot labels, and populate missing values from the
defaults specified in labels
formal argument.
Arguments
- labels
list
. User-defined plot labels. Per element, supportscharacter(1)
.,logical(1)
(for automatic labels), orNULL
.- argName
character(1)
. Argument name defined informalArgs()
to match against user input. Defaults to"labels"
.
Examples
fun <- function(
object,
labels = list(
"title" = NULL,
"x" = "x-axis",
"y" = "y-axis"
)) {
labels <- matchLabels(labels)
labels
}