@@ -129,11 +129,7 @@ layer <- function(geom = NULL, stat = NULL,
129
129
if (geom $ rename_size && " size" %in% extra_param && ! " linewidth" %in% mapped_aesthetics(mapping )) {
130
130
aes_params <- c(aes_params , params [" size" ])
131
131
extra_param <- setdiff(extra_param , " size" )
132
- # TODO: move to cli_warn()
133
- cli :: cli_inform(c(
134
- " {.field size} aesthetic has been deprecated for use with lines as of ggplot2 3.4.0" ,
135
- " i" = " Please use {.field linewidth} aesthetic instead"
136
- ), .frequency = " regularly" , .frequency_id = " ggplot-size-linewidth" )
132
+ lifecycle :: deprecate_warn(" 3.4.0" , I(" Using `size` aesthetic for lines" ), I(" `linewidth`" ))
137
133
}
138
134
if (check.param && length(extra_param ) > 0 ) {
139
135
cli :: cli_warn(" Ignoring unknown parameters: {.arg {extra_param}}" , call = call_env )
@@ -146,11 +142,7 @@ layer <- function(geom = NULL, stat = NULL,
146
142
# Take care of size->linewidth aes renaming
147
143
if (geom $ rename_size && " size" %in% extra_aes && ! " linewidth" %in% mapped_aesthetics(mapping )) {
148
144
extra_aes <- setdiff(extra_aes , " size" )
149
- # TODO: move to cli_warn()
150
- cli :: cli_inform(c(
151
- " {.field size} aesthetic has been deprecated for use with lines as of ggplot2 3.4.0" ,
152
- " i" = " Please use {.field linewidth} aesthetic instead"
153
- ), .frequency = " regularly" , .frequency_id = " ggplot-size-linewidth" )
145
+ lifecycle :: deprecate_warn(" 3.4.0" , I(" Using `size` aesthetic for lines" ), I(" `linewidth`" ))
154
146
}
155
147
if (check.aes && length(extra_aes ) > 0 ) {
156
148
cli :: cli_warn(" Ignoring unknown aesthetics: {.field {extra_aes}}" , call = call_env )
@@ -247,11 +239,7 @@ Layer <- ggproto("Layer", NULL,
247
239
! " linewidth" %in% names(self $ computed_mapping ) &&
248
240
" linewidth" %in% self $ geom $ aesthetics()) {
249
241
self $ computed_mapping $ size <- plot $ mapping $ size
250
- # TODO: move to cli_warn()
251
- cli :: cli_inform(c(
252
- " {.field size} aesthetic has been deprecated for use with lines as of ggplot2 3.4.0" ,
253
- " i" = " Please use {.field linewidth} aesthetic instead"
254
- ), .frequency = " regularly" , .frequency_id = " ggplot-size-linewidth" )
242
+ lifecycle :: deprecate_warn(" 3.4.0" , I(" Using `size` aesthetic for lines" ), I(" `linewidth`" ))
255
243
}
256
244
# defaults() strips class, but it needs to be preserved for now
257
245
class(self $ computed_mapping ) <- " uneval"
@@ -267,7 +255,7 @@ Layer <- ggproto("Layer", NULL,
267
255
268
256
# Drop aesthetics that are set or calculated
269
257
set <- names(aesthetics ) %in% names(self $ aes_params )
270
- calculated <- is_calculated_aes(aesthetics )
258
+ calculated <- is_calculated_aes(aesthetics , warn = TRUE )
271
259
modifiers <- is_scaled_aes(aesthetics )
272
260
273
261
aesthetics <- aesthetics [! set & ! calculated & ! modifiers ]
0 commit comments