@@ -84,8 +84,8 @@ setup_plot_labels <- function(plot, layers, data) {
84
84
))
85
85
}
86
86
87
- if (length(plot_labels $ dict ) > 0 ) {
88
- labels <- lapply(labels , revalue , replace = plot_labels $ dict )
87
+ if (length(plot_labels $ dictionary ) > 0 ) {
88
+ labels <- lapply(labels , revalue , replace = plot_labels $ dictionary )
89
89
}
90
90
91
91
defaults(plot_labels , labels )
@@ -118,9 +118,10 @@ setup_plot_labels <- function(plot, layers, data) {
118
118
# ' bottom-right of the plot by default.
119
119
# ' @param tag The text for the tag label which will be displayed at the
120
120
# ' top-left of the plot by default.
121
- # ' @param dict A named character vector to serve as dictionary. Automatically
122
- # ' derived labels, such as those based on variables will be matched with
123
- # ' `names(dict)` and replaced by the matching entry in `dict`.
121
+ # ' @param dictionary A named character vector to serve as dictionary.
122
+ # ' Automatically derived labels, such as those based on variables will
123
+ # ' be matched with `names(dictionary)` and replaced by the matching
124
+ # ' entry in `dictionary`.
124
125
# ' @param alt,alt_insight Text used for the generation of alt-text for the plot.
125
126
# ' See [get_alt_text] for examples. `alt` can also be a function that
126
127
# ' takes the plot as input and returns text as output. `alt` also accepts
@@ -161,12 +162,12 @@ setup_plot_labels <- function(plot, layers, data) {
161
162
# ' labs(title = "title") +
162
163
# ' labs(title = NULL)
163
164
labs <- function (... , title = waiver(), subtitle = waiver(), caption = waiver(),
164
- tag = waiver(), dict = waiver(), alt = waiver(),
165
+ tag = waiver(), dictionary = waiver(), alt = waiver(),
165
166
alt_insight = waiver()) {
166
167
# .ignore_empty = "all" is needed to allow trailing commas, which is NOT a trailing comma for dots_list() as it's in ...
167
168
args <- dots_list(... , title = title , subtitle = subtitle , caption = caption ,
168
- tag = tag , alt = allow_lambda(alt ), alt_insight = alt_insight , dict = dict ,
169
- .ignore_empty = " all" )
169
+ tag = tag , alt = allow_lambda(alt ), alt_insight = alt_insight ,
170
+ dictionary = dictionary , .ignore_empty = " all" )
170
171
171
172
is_waive <- vapply(args , is.waive , logical (1 ))
172
173
args <- args [! is_waive ]
0 commit comments