diff --git a/R/label-currency.R b/R/label-currency.R index d141670d..56979a2f 100644 --- a/R/label-currency.R +++ b/R/label-currency.R @@ -166,8 +166,7 @@ dollar <- function(x, accuracy = NULL, scale = 1, prefix = "$", } if (lifecycle::is_present(negative_parens)) { - lifecycle::deprecate_warn("1.2.0", "dollar(negative_parens)", "dollar(style_negative)") - style_negative <- if (negative_parens) "parens" else "minus" + lifecycle::deprecate_stop("1.2.0", "dollar(negative_parens)", "dollar(style_negative)") } number( diff --git a/R/label-number-si.R b/R/label-number-si.R index 087b5829..c8e565cc 100644 --- a/R/label-number-si.R +++ b/R/label-number-si.R @@ -29,19 +29,11 @@ #' # If you want the existing behavior, use cut_short_scale() #' demo_continuous(c(1, 1e9), labels = label_number(scale_cut = cut_short_scale())) label_number_si <- function(unit = "", accuracy = NULL, scale = 1, suffix = "", ...) { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( when = "1.2.0", what = "label_number_si()", with = "label_number(scale_cut)" ) - - label_number( - suffix = suffix, - scale_cut = cut_bad_si(unit), - accuracy = accuracy, - scale = scale, - ... - ) } cut_bad_si <- function(unit) { diff --git a/R/label-number.R b/R/label-number.R index dadba4c7..94b45a13 100644 --- a/R/label-number.R +++ b/R/label-number.R @@ -150,7 +150,7 @@ label_comma <- function(accuracy = NULL, scale = 1, prefix = "", suffix = "", big.mark = ",", decimal.mark = ".", trim = TRUE, digits, ...) { if (!missing(digits)) { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( when = "1.0.0", what = "label_comma(digits)", with = "label_comma(accuracy)" @@ -184,7 +184,7 @@ comma <- function(x, accuracy = NULL, scale = 1, prefix = "", suffix = "", big.mark = ",", decimal.mark = ".", trim = TRUE, digits, ...) { if (!missing(digits)) { - lifecycle::deprecate_warn( + lifecycle::deprecate_stop( when = "1.0.0", what = "comma(digits)", with = "comma(accuracy)" diff --git a/R/pal-gradient.R b/R/pal-gradient.R index ae4e23d5..efaf753c 100644 --- a/R/pal-gradient.R +++ b/R/pal-gradient.R @@ -8,10 +8,9 @@ #' @param space colour space in which to calculate gradient. Must be "Lab" - #' other values are deprecated. #' @export - pal_gradient_n <- function(colours, values = NULL, space = "Lab") { if (!identical(space, "Lab")) { - lifecycle::deprecate_warn("0.3.0", "pal_gradient_n(space = 'only supports be \"Lab\"')") + lifecycle::deprecate_stop("0.3.0", "pal_gradient_n(space = 'only supports be \"Lab\"')") } ramp <- colour_ramp(colours) force(values) diff --git a/tests/testthat/test-label-currency.R b/tests/testthat/test-label-currency.R index cdb23d7c..b8dabfea 100644 --- a/tests/testthat/test-label-currency.R +++ b/tests/testthat/test-label-currency.R @@ -3,10 +3,7 @@ test_that("negative comes before prefix", { }) test_that("negative_parens is deprecated", { - lifecycle::expect_deprecated({ - out <- label_dollar(negative_parens = TRUE)(-1) - }) - expect_equal(out, "($1)") + lifecycle::expect_defunct(label_dollar(negative_parens = TRUE)(1)) }) test_that("preserves NAs", { diff --git a/tests/testthat/test-label-number-si.R b/tests/testthat/test-label-number-si.R index ccce2043..4608862c 100644 --- a/tests/testthat/test-label-number-si.R +++ b/tests/testthat/test-label-number-si.R @@ -1,7 +1,5 @@ test_that("label_number_si() is deprecated", { - lifecycle::expect_deprecated(lab <- label_number_si("")) - expect_equal(lab(c(0, 1e3, 1e6)), c("0", "1K", "1M")) + lifecycle::expect_defunct(label_number_si("")) - lifecycle::expect_deprecated(lab <- label_number_si("m")) - expect_equal(lab(c(0, 1e3, 1e6)), c("0 m", "1 Km", "1 Mm")) + lifecycle::expect_defunct(label_number_si("m")) })