@@ -129,11 +129,7 @@ layer <- function(geom = NULL, stat = NULL,
129129 if (geom $ rename_size && " size" %in% extra_param && ! " linewidth" %in% mapped_aesthetics(mapping )) {
130130 aes_params <- c(aes_params , params [" size" ])
131131 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`" ))
137133 }
138134 if (check.param && length(extra_param ) > 0 ) {
139135 cli :: cli_warn(" Ignoring unknown parameters: {.arg {extra_param}}" , call = call_env )
@@ -146,11 +142,7 @@ layer <- function(geom = NULL, stat = NULL,
146142 # Take care of size->linewidth aes renaming
147143 if (geom $ rename_size && " size" %in% extra_aes && ! " linewidth" %in% mapped_aesthetics(mapping )) {
148144 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`" ))
154146 }
155147 if (check.aes && length(extra_aes ) > 0 ) {
156148 cli :: cli_warn(" Ignoring unknown aesthetics: {.field {extra_aes}}" , call = call_env )
@@ -247,11 +239,7 @@ Layer <- ggproto("Layer", NULL,
247239 ! " linewidth" %in% names(self $ computed_mapping ) &&
248240 " linewidth" %in% self $ geom $ aesthetics()) {
249241 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`" ))
255243 }
256244 # defaults() strips class, but it needs to be preserved for now
257245 class(self $ computed_mapping ) <- " uneval"
@@ -267,7 +255,7 @@ Layer <- ggproto("Layer", NULL,
267255
268256 # Drop aesthetics that are set or calculated
269257 set <- names(aesthetics ) %in% names(self $ aes_params )
270- calculated <- is_calculated_aes(aesthetics )
258+ calculated <- is_calculated_aes(aesthetics , warn = TRUE )
271259 modifiers <- is_scaled_aes(aesthetics )
272260
273261 aesthetics <- aesthetics [! set & ! calculated & ! modifiers ]
0 commit comments