Skip to content

Commit 02a6cde

Browse files
committed
replace deprecate_warn
1 parent a75da73 commit 02a6cde

19 files changed

+79
-69
lines changed

R/aes-evaluation.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ is_calculated <- function(x, warn = FALSE) {
257257
what <- I(paste0("The dot-dot notation (`", x, "`)"))
258258
var <- gsub(match_calculated_aes, "\\1", as.character(x))
259259
with <- I(paste0("`after_stat(", var, ")`"))
260-
deprecate_warn0("3.4.0", what, with, id = "ggplot-warn-aes-dot-dot")
260+
deprecate("3.4.0", what, with, id = "ggplot-warn-aes-dot-dot")
261261
}
262262
res
263263
} else if (is_quosure(x)) {
@@ -268,7 +268,7 @@ is_calculated <- function(x, warn = FALSE) {
268268
what <- I(paste0("`", expr_deparse(x), "`"))
269269
x[[1]] <- quote(after_stat)
270270
with <- I(paste0("`", expr_deparse(x), "`"))
271-
deprecate_warn0("3.4.0", what, with, id = "ggplot-warn-aes-stat")
271+
deprecate("3.4.0", what, with, id = "ggplot-warn-aes-stat")
272272
}
273273
TRUE
274274
} else {

R/aes.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ is_position_aes <- function(vars) {
283283
#'
284284
#' @export
285285
aes_ <- function(x, y, ...) {
286-
deprecate_warn0(
286+
deprecate(
287287
"3.0.0",
288288
"aes_()",
289289
details = "Please use tidy evaluation idioms with `aes()`"
@@ -310,7 +310,7 @@ aes_ <- function(x, y, ...) {
310310
#' @rdname aes_
311311
#' @export
312312
aes_string <- function(x, y, ...) {
313-
deprecate_warn0(
313+
deprecate(
314314
"3.0.0",
315315
"aes_string()",
316316
details = c(

R/bin.R

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,6 @@ bin_loc <- function(x, id) {
247247

248248
fix_bin_params <- function(params, fun, version) {
249249

250-
if (package_version(version) < "3.0.0") {
251-
deprecate <- lifecycle::deprecate_stop
252-
} else {
253-
deprecate <- deprecate_warn0
254-
}
255-
256250
if (!is.null(params$origin)) {
257251
args <- paste0(fun, c("(origin)", "(boundary)"))
258252
deprecate(version, args[1], args[2])

R/coord-radial.R

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,23 @@ coord_radial <- function(theta = "x",
123123
rotate_angle = deprecated()) {
124124

125125
if (lifecycle::is_present(r_axis_inside)) {
126-
deprecate_warn0(
127-
"3.5.1", "coord_radial(r_axis_inside)", "coord_radial(r.axis.inside)"
126+
deprecate(
127+
"coord_radial(r_axis_inside)", "coord_radial(r.axis.inside)",
128+
when = "3.5.1", escalate = "warn"
128129
)
129130
r.axis.inside <- r_axis_inside
130131
}
131132
if (lifecycle::is_present(rotate_angle)) {
132-
deprecate_warn0(
133-
"3.5.1", "coord_radial(rotate_angle)", "coord_radial(rotate.angle)"
133+
deprecate(
134+
"coord_radial(rotate_angle)", "coord_radial(rotate.angle)",
135+
when = "3.5.1", escalate = "warn"
134136
)
135137
rotate.angle <- rotate_angle
136138
}
137139
if (lifecycle::is_present(direction)) {
138-
deprecate_warn0(
139-
"4.0.0", "coord_radial(direction)", "coord_radial(reverse)"
140+
deprecate(
141+
"4.0.0", "coord_radial(direction)", "coord_radial(reverse)",
142+
when = "4.0.0", escalate = "warn"
140143
)
141144
reverse <- switch(reverse, "r" = "thetar", "theta")
142145
}

R/coord-transform.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ coord_transform <- function(x = "identity", y = "identity", xlim = NULL, ylim =
8484
limx = deprecated(), limy = deprecated(), clip = "on",
8585
expand = TRUE, reverse = "none") {
8686
if (lifecycle::is_present(limx)) {
87-
deprecate_warn0("3.3.0", "coord_transform(limx)", "coord_transform(xlim)")
87+
deprecate("3.3.0", "coord_transform(limx)", "coord_transform(xlim)")
8888
xlim <- limx
8989
}
9090
if (lifecycle::is_present(limy)) {
91-
deprecate_warn0("3.3.0", "coord_transform(limy)", "coord_transform(ylim)")
91+
deprecate("3.3.0", "coord_transform(limy)", "coord_transform(ylim)")
9292
ylim <- limy
9393
}
9494

R/fortify-map.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#' geom_polygon(aes(group = group), colour = "white")
2828
#' }
2929
fortify.map <- function(model, data, ...) {
30-
lifecycle::deprecate_warn(
31-
"4.0.0", I("`fortify(<map>)`"), "map_data()"
30+
deprecate(
31+
"4.0.0", I("`fortify(<map>)`"), "map_data()", escalate = "warn"
3232
)
3333
df <- data_frame0(
3434
long = model$x,

R/fortify-models.R

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@
3838
#' ggplot(augment(mod, mtcars), aes(.fitted, .std.resid, colour = factor(cyl))) +
3939
#' geom_point()
4040
fortify.lm <- function(model, data = model$model, ...) {
41-
lifecycle::deprecate_warn(
42-
"4.0.0", I("`fortify(<lm>)`"), I("`broom::augment(<lm>)`")
41+
deprecate(
42+
"4.0.0", escalate = "warn",
43+
I("`fortify(<lm>)`"), I("`broom::augment(<lm>)`")
4344
)
4445
infl <- stats::influence(model, do.coef = FALSE)
4546
data$.hat <- infl$hat
@@ -101,8 +102,9 @@ NULL
101102
#' @rdname fortify-multcomp
102103
#' @export
103104
fortify.glht <- function(model, data, ...) {
104-
lifecycle::deprecate_warn(
105-
"4.0.0", I("`fortify(<glht>)`"), I("`broom::tidy(<glht>)`")
105+
deprecate(
106+
"4.0.0", escalate = "warn",
107+
I("`fortify(<glht>)`"), I("`broom::tidy(<glht>)`")
106108
)
107109
base::data.frame(
108110
lhs = rownames(model$linfct),
@@ -117,8 +119,9 @@ fortify.glht <- function(model, data, ...) {
117119
#' @method fortify confint.glht
118120
#' @export
119121
fortify.confint.glht <- function(model, data, ...) {
120-
lifecycle::deprecate_warn(
121-
"4.0.0", I("`fortify(<confint.glht>)`"), I("`broom::tidy(<confint.glht>)`")
122+
deprecate(
123+
"4.0.0", escalate = "warn",
124+
I("`fortify(<confint.glht>)`"), I("`broom::tidy(<confint.glht>)`")
122125
)
123126
coef <- model$confint
124127
colnames(coef) <- to_lower_ascii(colnames(coef))
@@ -136,8 +139,9 @@ fortify.confint.glht <- function(model, data, ...) {
136139
#' @rdname fortify-multcomp
137140
#' @export
138141
fortify.summary.glht <- function(model, data, ...) {
139-
lifecycle::deprecate_warn(
140-
"4.0.0", I("`fortify(<summary.glht>)`"), I("`broom::tidy(<summary.glht>)`")
142+
deprecate(
143+
"4.0.0", escalate = "warn",
144+
I("`fortify(<summary.glht>)`"), I("`broom::tidy(<summary.glht>)`")
141145
)
142146
coef <- as.data.frame(
143147
model$test[c("coefficients", "sigma", "tstat", "pvalues")])
@@ -157,8 +161,9 @@ fortify.summary.glht <- function(model, data, ...) {
157161
#' @rdname fortify-multcomp
158162
#' @export
159163
fortify.cld <- function(model, data, ...) {
160-
lifecycle::deprecate_warn(
161-
"4.0.0", I("`fortify(<summary.glht>)`"), I("`broom::tidy(<summary.glht>)`")
164+
deprecate(
165+
"4.0.0", escalate = "warn",
166+
I("`fortify(<summary.glht>)`"), I("`broom::tidy(<summary.glht>)`")
162167
)
163168
base::data.frame(
164169
lhs = names(model$mcletters$Letters),

R/fortify-spatial.R

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ NULL
1818
#' @export
1919
#' @method fortify SpatialPolygonsDataFrame
2020
fortify.SpatialPolygonsDataFrame <- function(model, data, region = NULL, ...) {
21-
deprecate_warn0("3.4.4",
21+
deprecate(
22+
"3.4.4", escalate = "warn",
2223
I("`fortify(<SpatialPolygonsDataFrame>)`"),
2324
details = "Please migrate to sf."
2425
)
@@ -45,7 +46,8 @@ fortify.SpatialPolygonsDataFrame <- function(model, data, region = NULL, ...) {
4546
#' @export
4647
#' @method fortify SpatialPolygons
4748
fortify.SpatialPolygons <- function(model, data, ...) {
48-
deprecate_warn0("3.4.4",
49+
deprecate(
50+
"3.4.4", escalate = "warn",
4951
I("`fortify(<SpatialPolygons>)`"),
5052
details = "Please migrate to sf."
5153
)
@@ -61,7 +63,8 @@ fortify.SpatialPolygons <- function(model, data, ...) {
6163
#' @export
6264
#' @method fortify Polygons
6365
fortify.Polygons <- function(model, data, ...) {
64-
deprecate_warn0("3.4.4",
66+
deprecate(
67+
"3.4.4", escalate = "warn",
6568
I("`fortify(<Polygons>)`"),
6669
details = "Please migrate to sf."
6770
)
@@ -85,7 +88,8 @@ fortify.Polygons <- function(model, data, ...) {
8588
#' @export
8689
#' @method fortify Polygon
8790
fortify.Polygon <- function(model, data, ...) {
88-
deprecate_warn0("3.4.4",
91+
deprecate(
92+
"3.4.4", escalate = "warn",
8993
I("`fortify(<Polygon>)`"),
9094
details = "Please migrate to sf."
9195
)
@@ -101,7 +105,8 @@ fortify.Polygon <- function(model, data, ...) {
101105
#' @export
102106
#' @method fortify SpatialLinesDataFrame
103107
fortify.SpatialLinesDataFrame <- function(model, data, ...) {
104-
deprecate_warn0("3.4.4",
108+
deprecate(
109+
"3.4.4", escalate = "warn",
105110
I("`fortify(<SpatialLinesDataFrame>)`"),
106111
details = "Please migrate to sf."
107112
)
@@ -114,7 +119,8 @@ fortify.SpatialLinesDataFrame <- function(model, data, ...) {
114119
#' @export
115120
#' @method fortify Lines
116121
fortify.Lines <- function(model, data, ...) {
117-
deprecate_warn0("3.4.4",
122+
deprecate(
123+
"3.4.4", escalate = "warn",
118124
I("`fortify(<Lines>)`"),
119125
details = "Please migrate to sf."
120126
)
@@ -138,7 +144,8 @@ fortify.Lines <- function(model, data, ...) {
138144
#' @export
139145
#' @method fortify Line
140146
fortify.Line <- function(model, data, ...) {
141-
deprecate_warn0("3.4.4",
147+
deprecate(
148+
"3.4.4", escalate = "warn",,
142149
I("`fortify(<Line>)`"),
143150
details = "Please migrate to sf."
144151
)

R/geom-.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ Geom <- ggproto(
206206
# Take care of subclasses setting the wrong default when inheriting from
207207
# a geom with rename_size = TRUE
208208
if (self$rename_size && is.null(default_aes$linewidth)) {
209-
deprecate_warn0("3.4.0", I("Using the `size` aesthetic in this geom"), I("`linewidth` in the `default_aes` field and elsewhere"))
209+
deprecate("3.4.0", I("Using the `size` aesthetic in this geom"), I("`linewidth` in the `default_aes` field and elsewhere"))
210210
default_aes$linewidth <- default_aes$size
211211
}
212212

@@ -530,7 +530,7 @@ check_aesthetics <- function(x, n) {
530530

531531
fix_linewidth <- function(data, name) {
532532
if (is.null(data$linewidth) && !is.null(data$size)) {
533-
deprecate_warn0("3.4.0", I(paste0("Using the `size` aesthetic with ", name)), I("the `linewidth` aesthetic"))
533+
deprecate("3.4.0", I(paste0("Using the `size` aesthetic with ", name)), I("the `linewidth` aesthetic"))
534534
data$linewidth <- data$size
535535
}
536536
data

R/geom-sf.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,10 @@ geom_sf_label <- function(mapping = aes(), data = NULL,
329329

330330
extra_args <- list2(...)
331331
if (lifecycle::is_present(label.size)) {
332-
deprecate_warn0("3.5.0", "geom_label(label.size)", "geom_label(linewidth)")
332+
deprecate(
333+
"3.5.0", escalate = "warn",
334+
"geom_label(label.size)", "geom_label(linewidth)"
335+
)
333336
extra_args$linewidth <- extra_args$linewidth %||% label.size
334337
}
335338

0 commit comments

Comments
 (0)