Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/aes-evaluation.R
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ is_calculated <- function(x, warn = FALSE) {
what <- I(paste0("The dot-dot notation (`", x, "`)"))
var <- gsub(match_calculated_aes, "\\1", as.character(x))
with <- I(paste0("`after_stat(", var, ")`"))
deprecate_warn0("3.4.0", what, with, id = "ggplot-warn-aes-dot-dot")
deprecate("3.4.0", what, with, id = "ggplot-warn-aes-dot-dot")
}
res
} else if (is_quosure(x)) {
Expand All @@ -268,7 +268,7 @@ is_calculated <- function(x, warn = FALSE) {
what <- I(paste0("`", expr_deparse(x), "`"))
x[[1]] <- quote(after_stat)
with <- I(paste0("`", expr_deparse(x), "`"))
deprecate_warn0("3.4.0", what, with, id = "ggplot-warn-aes-stat")
deprecate("3.4.0", what, with, id = "ggplot-warn-aes-stat")
}
TRUE
} else {
Expand Down
4 changes: 2 additions & 2 deletions R/aes.R
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ is_position_aes <- function(vars) {
#'
#' @export
aes_ <- function(x, y, ...) {
deprecate_warn0(
deprecate(
"3.0.0",
"aes_()",
details = "Please use tidy evaluation idioms with `aes()`"
Expand All @@ -310,7 +310,7 @@ aes_ <- function(x, y, ...) {
#' @rdname aes_
#' @export
aes_string <- function(x, y, ...) {
deprecate_warn0(
deprecate(
"3.0.0",
"aes_string()",
details = c(
Expand Down
2 changes: 1 addition & 1 deletion R/annotation-borders.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ annotation_borders <- function(database = "world", regions = ".", fill = NA,
#' @rdname annotation_borders
#' @usage borders(...) # Deprecated
borders <- function(...) {
deprecate_soft0("4.0.0", "borders()", "annotation_borders()")
deprecate("4.0.0", "borders()", "annotation_borders()")
annotation_borders(...)
}
2 changes: 1 addition & 1 deletion R/annotation-logticks.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ annotation_logticks <- function(base = 10, sides = "bl", outside = FALSE, scaled
lifecycle::signal_stage("superseded", "annotation_logticks()", "guide_axis_logticks()")

if (lifecycle::is_present(size)) {
deprecate_soft0("3.5.0", I("Using the `size` aesthetic in this geom"), I("`linewidth`"))
deprecate("3.5.0", I("Using the `size` aesthetic in this geom"), I("`linewidth`"))
linewidth <- linewidth %||% size
}

Expand Down
2 changes: 1 addition & 1 deletion R/axis-secondary.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ sec_axis <- function(transform = NULL,
name = waiver(), breaks = waiver(), labels = waiver(),
guide = waiver(), trans = deprecated()) {
if (lifecycle::is_present(trans)) {
deprecate_soft0("3.5.0", "sec_axis(trans)", "sec_axis(transform)")
deprecate("3.5.0", "sec_axis(trans)", "sec_axis(transform)")
transform <- trans
}

Expand Down
6 changes: 0 additions & 6 deletions R/bin.R
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,6 @@ bin_loc <- function(x, id) {

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

if (package_version(version) < "3.0.0") {
deprecate <- lifecycle::deprecate_stop
} else {
deprecate <- deprecate_warn0
}

if (!is.null(params$origin)) {
args <- paste0(fun, c("(origin)", "(boundary)"))
deprecate(version, args[1], args[2])
Expand Down
2 changes: 1 addition & 1 deletion R/coord-.R
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ is_coord <- function(x) inherits(x, "Coord")
#' @rdname is_tests
#' @usage is.Coord(x) # Deprecated
is.Coord <- function(x) {
deprecate_soft0("3.5.2", "is.Coord()", "is_coord()")
deprecate("3.5.2", "is.Coord()", "is_coord()")
is_coord(x)
}

Expand Down
15 changes: 9 additions & 6 deletions R/coord-radial.R
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,23 @@ coord_radial <- function(theta = "x",
rotate_angle = deprecated()) {

if (lifecycle::is_present(r_axis_inside)) {
deprecate_warn0(
"3.5.1", "coord_radial(r_axis_inside)", "coord_radial(r.axis.inside)"
deprecate(
"coord_radial(r_axis_inside)", "coord_radial(r.axis.inside)",
when = "3.5.1", escalate = "warn"
)
r.axis.inside <- r_axis_inside
}
if (lifecycle::is_present(rotate_angle)) {
deprecate_warn0(
"3.5.1", "coord_radial(rotate_angle)", "coord_radial(rotate.angle)"
deprecate(
"coord_radial(rotate_angle)", "coord_radial(rotate.angle)",
when = "3.5.1", escalate = "warn"
)
rotate.angle <- rotate_angle
}
if (lifecycle::is_present(direction)) {
deprecate_warn0(
"4.0.0", "coord_radial(direction)", "coord_radial(reverse)"
deprecate(
"4.0.0", "coord_radial(direction)", "coord_radial(reverse)",
when = "4.0.0", escalate = "warn"
)
reverse <- switch(reverse, "r" = "thetar", "theta")
}
Expand Down
6 changes: 3 additions & 3 deletions R/coord-transform.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ coord_transform <- function(x = "identity", y = "identity", xlim = NULL, ylim =
limx = deprecated(), limy = deprecated(), clip = "on",
expand = TRUE, reverse = "none") {
if (lifecycle::is_present(limx)) {
deprecate_warn0("3.3.0", "coord_transform(limx)", "coord_transform(xlim)")
deprecate("3.3.0", "coord_transform(limx)", "coord_transform(xlim)")
xlim <- limx
}
if (lifecycle::is_present(limy)) {
deprecate_warn0("3.3.0", "coord_transform(limy)", "coord_transform(ylim)")
deprecate("3.3.0", "coord_transform(limy)", "coord_transform(ylim)")
ylim <- limy
}

Expand All @@ -112,7 +112,7 @@ coord_transform <- function(x = "identity", y = "identity", xlim = NULL, ylim =
#' @rdname coord_transform
#' @export
coord_trans <- function(...) {
deprecate_soft0(
deprecate(
"4.0.0",
"coord_trans()",
"coord_transform()"
Expand Down
2 changes: 1 addition & 1 deletion R/facet-.R
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ is_facet <- function(x) inherits(x, "Facet")
#' @rdname is_tests
#' @usage is.facet(x) # Deprecated
is.facet <- function(x) {
deprecate_soft0("3.5.2", "is.facet()", "is_facet()")
deprecate("3.5.2", "is.facet()", "is_facet()")
is_facet(x)
}

Expand Down
2 changes: 1 addition & 1 deletion R/facet-wrap.R
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ wrap_layout <- function(id, dims, dir) {
if (nchar(dir) != 2) {
# Should only occur when `as.table` was not incorporated into `dir`
dir <- switch(dir, h = "lt", v = "tl")
deprecate_soft0(
deprecate(
"4.0.0",
what = I("Internal use of `dir = \"h\"` and `dir = \"v\"` in `facet_wrap()`"),
details = I(c(
Expand Down
4 changes: 2 additions & 2 deletions R/fortify-map.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#' geom_polygon(aes(group = group), colour = "white")
#' }
fortify.map <- function(model, data, ...) {
lifecycle::deprecate_warn(
"4.0.0", I("`fortify(<map>)`"), "map_data()"
deprecate(
"4.0.0", I("`fortify(<map>)`"), "map_data()", escalate = "warn"
)
df <- data_frame0(
long = model$x,
Expand Down
25 changes: 15 additions & 10 deletions R/fortify-models.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@
#' ggplot(augment(mod, mtcars), aes(.fitted, .std.resid, colour = factor(cyl))) +
#' geom_point()
fortify.lm <- function(model, data = model$model, ...) {
lifecycle::deprecate_warn(
"4.0.0", I("`fortify(<lm>)`"), I("`broom::augment(<lm>)`")
deprecate(
"4.0.0", escalate = "warn",
I("`fortify(<lm>)`"), I("`broom::augment(<lm>)`")
)
infl <- stats::influence(model, do.coef = FALSE)
data$.hat <- infl$hat
Expand Down Expand Up @@ -101,8 +102,9 @@ NULL
#' @rdname fortify-multcomp
#' @export
fortify.glht <- function(model, data, ...) {
lifecycle::deprecate_warn(
"4.0.0", I("`fortify(<glht>)`"), I("`broom::tidy(<glht>)`")
deprecate(
"4.0.0", escalate = "warn",
I("`fortify(<glht>)`"), I("`broom::tidy(<glht>)`")
)
base::data.frame(
lhs = rownames(model$linfct),
Expand All @@ -117,8 +119,9 @@ fortify.glht <- function(model, data, ...) {
#' @method fortify confint.glht
#' @export
fortify.confint.glht <- function(model, data, ...) {
lifecycle::deprecate_warn(
"4.0.0", I("`fortify(<confint.glht>)`"), I("`broom::tidy(<confint.glht>)`")
deprecate(
"4.0.0", escalate = "warn",
I("`fortify(<confint.glht>)`"), I("`broom::tidy(<confint.glht>)`")
)
coef <- model$confint
colnames(coef) <- to_lower_ascii(colnames(coef))
Expand All @@ -136,8 +139,9 @@ fortify.confint.glht <- function(model, data, ...) {
#' @rdname fortify-multcomp
#' @export
fortify.summary.glht <- function(model, data, ...) {
lifecycle::deprecate_warn(
"4.0.0", I("`fortify(<summary.glht>)`"), I("`broom::tidy(<summary.glht>)`")
deprecate(
"4.0.0", escalate = "warn",
I("`fortify(<summary.glht>)`"), I("`broom::tidy(<summary.glht>)`")
)
coef <- as.data.frame(
model$test[c("coefficients", "sigma", "tstat", "pvalues")])
Expand All @@ -157,8 +161,9 @@ fortify.summary.glht <- function(model, data, ...) {
#' @rdname fortify-multcomp
#' @export
fortify.cld <- function(model, data, ...) {
lifecycle::deprecate_warn(
"4.0.0", I("`fortify(<summary.glht>)`"), I("`broom::tidy(<summary.glht>)`")
deprecate(
"4.0.0", escalate = "warn",
I("`fortify(<summary.glht>)`"), I("`broom::tidy(<summary.glht>)`")
)
base::data.frame(
lhs = names(model$mcletters$Letters),
Expand Down
21 changes: 14 additions & 7 deletions R/fortify-spatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ NULL
#' @export
#' @method fortify SpatialPolygonsDataFrame
fortify.SpatialPolygonsDataFrame <- function(model, data, region = NULL, ...) {
deprecate_warn0("3.4.4",
deprecate(
"3.4.4", escalate = "warn",
I("`fortify(<SpatialPolygonsDataFrame>)`"),
details = "Please migrate to sf."
)
Expand All @@ -45,7 +46,8 @@ fortify.SpatialPolygonsDataFrame <- function(model, data, region = NULL, ...) {
#' @export
#' @method fortify SpatialPolygons
fortify.SpatialPolygons <- function(model, data, ...) {
deprecate_warn0("3.4.4",
deprecate(
"3.4.4", escalate = "warn",
I("`fortify(<SpatialPolygons>)`"),
details = "Please migrate to sf."
)
Expand All @@ -61,7 +63,8 @@ fortify.SpatialPolygons <- function(model, data, ...) {
#' @export
#' @method fortify Polygons
fortify.Polygons <- function(model, data, ...) {
deprecate_warn0("3.4.4",
deprecate(
"3.4.4", escalate = "warn",
I("`fortify(<Polygons>)`"),
details = "Please migrate to sf."
)
Expand All @@ -85,7 +88,8 @@ fortify.Polygons <- function(model, data, ...) {
#' @export
#' @method fortify Polygon
fortify.Polygon <- function(model, data, ...) {
deprecate_warn0("3.4.4",
deprecate(
"3.4.4", escalate = "warn",
I("`fortify(<Polygon>)`"),
details = "Please migrate to sf."
)
Expand All @@ -101,7 +105,8 @@ fortify.Polygon <- function(model, data, ...) {
#' @export
#' @method fortify SpatialLinesDataFrame
fortify.SpatialLinesDataFrame <- function(model, data, ...) {
deprecate_warn0("3.4.4",
deprecate(
"3.4.4", escalate = "warn",
I("`fortify(<SpatialLinesDataFrame>)`"),
details = "Please migrate to sf."
)
Expand All @@ -114,7 +119,8 @@ fortify.SpatialLinesDataFrame <- function(model, data, ...) {
#' @export
#' @method fortify Lines
fortify.Lines <- function(model, data, ...) {
deprecate_warn0("3.4.4",
deprecate(
"3.4.4", escalate = "warn",
I("`fortify(<Lines>)`"),
details = "Please migrate to sf."
)
Expand All @@ -138,7 +144,8 @@ fortify.Lines <- function(model, data, ...) {
#' @export
#' @method fortify Line
fortify.Line <- function(model, data, ...) {
deprecate_warn0("3.4.4",
deprecate(
"3.4.4", escalate = "warn",,
I("`fortify(<Line>)`"),
details = "Please migrate to sf."
)
Expand Down
4 changes: 2 additions & 2 deletions R/geom-.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Geom <- ggproto(
# Take care of subclasses setting the wrong default when inheriting from
# a geom with rename_size = TRUE
if (self$rename_size && is.null(default_aes$linewidth)) {
deprecate_warn0("3.4.0", I("Using the `size` aesthetic in this geom"), I("`linewidth` in the `default_aes` field and elsewhere"))
deprecate("3.4.0", I("Using the `size` aesthetic in this geom"), I("`linewidth` in the `default_aes` field and elsewhere"))
default_aes$linewidth <- default_aes$size
}

Expand Down Expand Up @@ -530,7 +530,7 @@ check_aesthetics <- function(x, n) {

fix_linewidth <- function(data, name) {
if (is.null(data$linewidth) && !is.null(data$size)) {
deprecate_warn0("3.4.0", I(paste0("Using the `size` aesthetic with ", name)), I("the `linewidth` aesthetic"))
deprecate("3.4.0", I(paste0("Using the `size` aesthetic with ", name)), I("the `linewidth` aesthetic"))
data$linewidth <- data$size
}
data
Expand Down
2 changes: 1 addition & 1 deletion R/geom-boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ GeomBoxplot <- ggproto("GeomBoxplot", Geom,

setup_params = function(data, params) {
if ("fatten" %in% names(params)) {
deprecate_soft0(
deprecate(
"4.0.0", "geom_boxplot(fatten)",
"geom_boxplot(median.linewidth)"
)
Expand Down
2 changes: 1 addition & 1 deletion R/geom-crossbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ geom_crossbar <- function(mapping = NULL, data = NULL,
GeomCrossbar <- ggproto("GeomCrossbar", Geom,
setup_params = function(data, params) {
if (lifecycle::is_present(params$fatten %||% deprecated())) {
deprecate_soft0(
deprecate(
"4.0.0", "geom_crossbar(fatten)",
"geom_crossbar(middle.linewidth)"
)
Expand Down
4 changes: 2 additions & 2 deletions R/geom-errorbar.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ GeomErrorbar <- ggproto(
GeomErrorbarh <- ggproto(
"GeomErrorbarh", GeomErrorbar,
setup_params = function(data, params) {
deprecate_soft0(
deprecate(
"4.0.0", "geom_errorbarh()", "geom_errorbar(orientation = \"y\")",
id = "no-more-errorbarh"
)
Expand All @@ -95,7 +95,7 @@ geom_errorbar <- make_constructor(GeomErrorbar, orientation = NA)
#' `geom_errorbarh()` is `r lifecycle::badge("deprecated")`. Use
#' `geom_errorbar(orientation = "y")` instead.
geom_errorbarh <- function(..., orientation = "y") {
deprecate_soft0(
deprecate(
"4.0.0", "geom_errorbarh()", "geom_errorbar(orientation = \"y\")",
id = "no-more-errorbarh"
)
Expand Down
2 changes: 1 addition & 1 deletion R/geom-label.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ geom_label <- function(mapping = NULL, data = NULL,

extra_args <- list2(...)
if (lifecycle::is_present(label.size)) {
deprecate_soft0("3.5.0", "geom_label(label.size)", "geom_label(linewidth)")
deprecate("3.5.0", "geom_label(label.size)", "geom_label(linewidth)")
extra_args$linewidth <- extra_args$linewidth %||% label.size
}

Expand Down
2 changes: 1 addition & 1 deletion R/geom-pointrange.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ GeomPointrange <- ggproto("GeomPointrange", Geom,

setup_params = function(data, params) {
if (lifecycle::is_present(params$fatten %||% deprecated())) {
deprecate_soft0("4.0.0", "geom_pointrange(fatten)", I("the `size` aesthetic"))
deprecate("4.0.0", "geom_pointrange(fatten)", I("the `size` aesthetic"))
} else {
# For backward compatibility reasons
params$fatten <- 4
Expand Down
5 changes: 4 additions & 1 deletion R/geom-sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,10 @@ geom_sf_label <- function(mapping = aes(), data = NULL,

extra_args <- list2(...)
if (lifecycle::is_present(label.size)) {
deprecate_warn0("3.5.0", "geom_label(label.size)", "geom_label(linewidth)")
deprecate(
"3.5.0", escalate = "warn",
"geom_label(label.size)", "geom_label(linewidth)"
)
extra_args$linewidth <- extra_args$linewidth %||% label.size
}

Expand Down
2 changes: 1 addition & 1 deletion R/geom-violin.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ geom_violin <- function(mapping = NULL, data = NULL,

extra <- list()
if (lifecycle::is_present(draw_quantiles)) {
deprecate_soft0(
deprecate(
"4.0.0",
what = "geom_violin(draw_quantiles)",
with = "geom_violin(quantiles.linetype)"
Expand Down
2 changes: 1 addition & 1 deletion R/ggproto.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ is_ggproto <- function(x) inherits(x, "ggproto")
#' @rdname is_tests
#' @usage is.ggproto(x) # Deprecated
is.ggproto <- function(x) {
deprecate_soft0("3.5.2", "is.ggproto()", "is_ggproto()")
deprecate("3.5.2", "is.ggproto()", "is_ggproto()")
is_ggproto(x)
}

Expand Down
Loading