From acefeb28df76d8c34d80a1fa66d4bcdd0ea04084 Mon Sep 17 00:00:00 2001 From: Andrei Martins <92amartins@gmail.com> Date: Wed, 27 Mar 2024 21:10:41 -0300 Subject: [PATCH 1/5] Use lifecycle for arguments deprecation in ggpairs --- NAMESPACE | 1 + R/GGally-package.R | 1 + R/ggpairs.R | 66 +-- man/figures/lifecycle-archived.svg | 22 +- man/figures/lifecycle-defunct.svg | 22 +- man/figures/lifecycle-deprecated.svg | 22 +- man/figures/lifecycle-experimental.svg | 22 +- man/figures/lifecycle-maturing.svg | 22 +- man/figures/lifecycle-questioning.svg | 22 +- man/figures/lifecycle-soft-deprecated.svg | 22 +- man/figures/lifecycle-stable.svg | 30 +- man/figures/lifecycle-superseded.svg | 22 +- man/ggduo.Rd | 4 +- man/ggpairs.Rd | 10 +- tests/testthat/_snaps/gglegend/custom.new.svg | 33 ++ .../_snaps/gglegend/internal-legend.new.svg | 386 ++++++++++++++++++ tests/testthat/_snaps/gglegend/points.new.svg | 33 ++ .../_snaps/gglegend/pos-bottom.new.svg | 39 ++ .../testthat/_snaps/gglegend/pos-left.new.svg | 39 ++ .../_snaps/gglegend/pos-right.new.svg | 39 ++ .../testthat/_snaps/gglegend/pos-top.new.svg | 39 ++ tests/testthat/test-zzz_ggpairs.R | 13 +- 22 files changed, 853 insertions(+), 56 deletions(-) create mode 100644 tests/testthat/_snaps/gglegend/custom.new.svg create mode 100644 tests/testthat/_snaps/gglegend/internal-legend.new.svg create mode 100644 tests/testthat/_snaps/gglegend/points.new.svg create mode 100644 tests/testthat/_snaps/gglegend/pos-bottom.new.svg create mode 100644 tests/testthat/_snaps/gglegend/pos-left.new.svg create mode 100644 tests/testthat/_snaps/gglegend/pos-right.new.svg create mode 100644 tests/testthat/_snaps/gglegend/pos-top.new.svg diff --git a/NAMESPACE b/NAMESPACE index 6fe52a47b..defe34671 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -167,6 +167,7 @@ importFrom(grid,upViewport) importFrom(grid,viewport) importFrom(gtable,gtable_filter) importFrom(lifecycle,deprecate_soft) +importFrom(lifecycle,deprecated) importFrom(magrittr,"%>%") importFrom(plyr,ddply) importFrom(plyr,summarize) diff --git a/R/GGally-package.R b/R/GGally-package.R index 5a69da1a9..8324eb090 100644 --- a/R/GGally-package.R +++ b/R/GGally-package.R @@ -5,6 +5,7 @@ # roxygen namespace tags. Modify with care! ## usethis namespace: start #' @importFrom lifecycle deprecate_soft +#' @importFrom lifecycle deprecated ## usethis namespace: end NULL diff --git a/R/ggpairs.R b/R/ggpairs.R index 59ced19c1..5e0789a25 100644 --- a/R/ggpairs.R +++ b/R/ggpairs.R @@ -128,15 +128,6 @@ fix_column_values <- function( columns } -warn_deprecated <- function(is_supplied, title) { - if (is_supplied) { - warning(paste( - "'", title, "' will be deprecated in future versions. Please remove it from your code", - sep = "" - )) - } -} - stop_if_bad_mapping <- function(mapping) { if (is.numeric(mapping)) { stop( @@ -146,18 +137,6 @@ stop_if_bad_mapping <- function(mapping) { } } -warn_if_args_exist <- function(args) { - if (length(args) > 0) { - argNames <- names(args) - warning(str_c( - "Extra arguments: ", - str_c(shQuote(argNames), collapse = ", "), " are being ignored.", - " If these are meant to be aesthetics, submit them using the", - " 'mapping' variable within ggpairs with ggplot2::aes or ggplot2::aes_string." - )) - } -} - fix_axis_label_choice <- function(axisLabels, axisLabelChoices) { if (length(axisLabels) > 1) { axisLabels <- axisLabels[1] @@ -234,7 +213,7 @@ stop_if_high_cardinality <- function(data, columns, threshold) { #' @template ggmatrix-legend-param #' @param cardinality_threshold maximum number of levels allowed in a character / factor column. Set this value to NULL to not check factor columns. Defaults to 15 #' @template ggmatrix-progress -#' @param legends deprecated +#' @param legends `r lifecycle::badge('deprecated')` #' @param xProportions,yProportions Value to change how much area is given for each plot. Either \code{NULL} (default), numeric value matching respective length, \code{grid::\link[grid]{unit}} object with matching respective length or \code{"auto"} for automatic relative proportions based on the number of levels for categorical variables. #' @export #' @examples @@ -456,8 +435,14 @@ ggduo <- function( progress = NULL, xProportions = NULL, yProportions = NULL, - legends = stop("deprecated")) { - warn_deprecated(!missing(legends), "legends") + legends = deprecated()) { + if(lifecycle::is_present(legends)){ + lifecycle::deprecate_warn( + when = "2.2.2", + what = "ggduo(legends)", + details = "Ability to put legends in each plot will be dropped in next releases." + ) + } isSharedData <- inherits(data, "SharedData") data_ <- fix_data(data) @@ -623,8 +608,8 @@ ggduo <- function( #' @param upper see Details #' @param lower see Details #' @param diag see Details -#' @param params deprecated. Please see \code{\link{wrap_fn_with_param_arg}} -#' @param ... deprecated. Please use \code{mapping} +#' @param params `r lifecycle::badge("deprecated")` see \code{\link{wrap_fn_with_param_arg}} +#' @param ... `r lifecycle::badge("deprecated")` use \code{mapping} #' @param axisLabels either "show" to display axisLabels, "internal" for labels in the diagonal plots, or "none" for no axis labels #' @param columnLabels label names to be displayed. Defaults to names of columns being used. #' @param proportions Value to change how much area is given for each plot. Either \code{NULL} (default), numeric value matching respective length, \code{grid::\link[grid]{unit}} object with matching respective length or \code{"auto"} for automatic relative proportions based on the number of levels for categorical variables. @@ -634,7 +619,7 @@ ggduo <- function( #' @template ggmatrix-legend-param #' @param cardinality_threshold maximum number of levels allowed in a character / factor column. Set this value to NULL to not check factor columns. Defaults to 15 #' @template ggmatrix-progress -#' @param legends deprecated +#' @param legends `r lifecycle::badge("deprecated")` #' @keywords hplot #' @import ggplot2 #' @references John W Emerson, Walton A Green, Barret Schloerke, Jason Crowley, Dianne Cook, Heike Hofmann, Hadley Wickham. The Generalized Pairs Plot. Journal of Computational and Graphical Statistics, vol. 22, no. 1, pp. 79-91, 2012. @@ -768,7 +753,7 @@ ggpairs <- function( upper = list(continuous = "cor", combo = "box_no_facet", discrete = "count", na = "na"), lower = list(continuous = "points", combo = "facethist", discrete = "facetbar", na = "na"), diag = list(continuous = "densityDiag", discrete = "barDiag", na = "naDiag"), - params = NULL, + params = deprecated(), ..., xlab = NULL, ylab = NULL, @@ -781,10 +766,27 @@ ggpairs <- function( cardinality_threshold = 15, progress = NULL, proportions = NULL, - legends = stop("deprecated")) { - warn_deprecated(!missing(legends), "legends") - warn_if_args_exist(list(...)) - stop_if_params_exist(params) + legends = deprecated()) { + if(lifecycle::is_present(legends)){ + lifecycle::deprecate_warn( + when = "2.2.2", + what = "ggpairs(legends)", + details = "Ability to put legends in each plot will be dropped in next releases." + ) + } + if(lifecycle::is_present(params)){ + lifecycle::deprecate_warn( + when = "2.2.2", + what = "ggpairs(params)" + ) + } + if(lifecycle::is_present(list(...))){ + lifecycle::deprecate_warn( + when = "2.2.2", + what = "ggpairs(...)" + ) + } + isSharedData <- inherits(data, "SharedData") diff --git a/man/figures/lifecycle-archived.svg b/man/figures/lifecycle-archived.svg index 48f72a6f3..745ab0c78 100644 --- a/man/figures/lifecycle-archived.svg +++ b/man/figures/lifecycle-archived.svg @@ -1 +1,21 @@ - lifecyclelifecyclearchivedarchived \ No newline at end of file + + lifecycle: archived + + + + + + + + + + + + + + + lifecycle + + archived + + diff --git a/man/figures/lifecycle-defunct.svg b/man/figures/lifecycle-defunct.svg index 01452e5fb..d5c9559ed 100644 --- a/man/figures/lifecycle-defunct.svg +++ b/man/figures/lifecycle-defunct.svg @@ -1 +1,21 @@ -lifecyclelifecycledefunctdefunct \ No newline at end of file + + lifecycle: defunct + + + + + + + + + + + + + + + lifecycle + + defunct + + diff --git a/man/figures/lifecycle-deprecated.svg b/man/figures/lifecycle-deprecated.svg index 4baaee01c..b61c57c3f 100644 --- a/man/figures/lifecycle-deprecated.svg +++ b/man/figures/lifecycle-deprecated.svg @@ -1 +1,21 @@ -lifecyclelifecycledeprecateddeprecated \ No newline at end of file + + lifecycle: deprecated + + + + + + + + + + + + + + + lifecycle + + deprecated + + diff --git a/man/figures/lifecycle-experimental.svg b/man/figures/lifecycle-experimental.svg index d1d060e92..5d88fc2c6 100644 --- a/man/figures/lifecycle-experimental.svg +++ b/man/figures/lifecycle-experimental.svg @@ -1 +1,21 @@ -lifecyclelifecycleexperimentalexperimental \ No newline at end of file + + lifecycle: experimental + + + + + + + + + + + + + + + lifecycle + + experimental + + diff --git a/man/figures/lifecycle-maturing.svg b/man/figures/lifecycle-maturing.svg index df7131014..897370ecf 100644 --- a/man/figures/lifecycle-maturing.svg +++ b/man/figures/lifecycle-maturing.svg @@ -1 +1,21 @@ -lifecyclelifecyclematuringmaturing \ No newline at end of file + + lifecycle: maturing + + + + + + + + + + + + + + + lifecycle + + maturing + + diff --git a/man/figures/lifecycle-questioning.svg b/man/figures/lifecycle-questioning.svg index 08ee0c903..7c1721d05 100644 --- a/man/figures/lifecycle-questioning.svg +++ b/man/figures/lifecycle-questioning.svg @@ -1 +1,21 @@ -lifecyclelifecyclequestioningquestioning \ No newline at end of file + + lifecycle: questioning + + + + + + + + + + + + + + + lifecycle + + questioning + + diff --git a/man/figures/lifecycle-soft-deprecated.svg b/man/figures/lifecycle-soft-deprecated.svg index 9f014fd19..9c166ff30 100644 --- a/man/figures/lifecycle-soft-deprecated.svg +++ b/man/figures/lifecycle-soft-deprecated.svg @@ -1 +1,21 @@ -lifecyclelifecyclesoft-deprecatedsoft-deprecated \ No newline at end of file + + lifecycle: soft-deprecated + + + + + + + + + + + + + + + lifecycle + + soft-deprecated + + diff --git a/man/figures/lifecycle-stable.svg b/man/figures/lifecycle-stable.svg index e015dc811..9bf21e76b 100644 --- a/man/figures/lifecycle-stable.svg +++ b/man/figures/lifecycle-stable.svg @@ -1 +1,29 @@ -lifecyclelifecyclestablestable \ No newline at end of file + + lifecycle: stable + + + + + + + + + + + + + + + + lifecycle + + + + stable + + + diff --git a/man/figures/lifecycle-superseded.svg b/man/figures/lifecycle-superseded.svg index 75f24f553..db8d757f7 100644 --- a/man/figures/lifecycle-superseded.svg +++ b/man/figures/lifecycle-superseded.svg @@ -1 +1,21 @@ - lifecyclelifecyclesupersededsuperseded \ No newline at end of file + + lifecycle: superseded + + + + + + + + + + + + + + + lifecycle + + superseded + + diff --git a/man/ggduo.Rd b/man/ggduo.Rd index b8f97a316..5ffd37901 100644 --- a/man/ggduo.Rd +++ b/man/ggduo.Rd @@ -25,7 +25,7 @@ ggduo( progress = NULL, xProportions = NULL, yProportions = NULL, - legends = stop("deprecated") + legends = deprecated() ) } \arguments{ @@ -57,7 +57,7 @@ ggduo( \item{xProportions, yProportions}{Value to change how much area is given for each plot. Either \code{NULL} (default), numeric value matching respective length, \code{grid::\link[grid]{unit}} object with matching respective length or \code{"auto"} for automatic relative proportions based on the number of levels for categorical variables.} -\item{legends}{deprecated} +\item{legends}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}} } \description{ Make a matrix of plots with a given data set with two different column sets diff --git a/man/ggpairs.Rd b/man/ggpairs.Rd index 23a566ef0..cb49e89d1 100644 --- a/man/ggpairs.Rd +++ b/man/ggpairs.Rd @@ -13,7 +13,7 @@ ggpairs( lower = list(continuous = "points", combo = "facethist", discrete = "facetbar", na = "na"), diag = list(continuous = "densityDiag", discrete = "barDiag", na = "naDiag"), - params = NULL, + params = deprecated(), ..., xlab = NULL, ylab = NULL, @@ -26,7 +26,7 @@ ggpairs( cardinality_threshold = 15, progress = NULL, proportions = NULL, - legends = stop("deprecated") + legends = deprecated() ) } \arguments{ @@ -44,9 +44,9 @@ ggpairs( \item{diag}{see Details} -\item{params}{deprecated. Please see \code{\link{wrap_fn_with_param_arg}}} +\item{params}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} see \code{\link{wrap_fn_with_param_arg}}} -\item{...}{deprecated. Please use \code{mapping}} +\item{...}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}} use \code{mapping}} \item{axisLabels}{either "show" to display axisLabels, "internal" for labels in the diagonal plots, or "none" for no axis labels} @@ -66,7 +66,7 @@ ggpairs( \item{proportions}{Value to change how much area is given for each plot. Either \code{NULL} (default), numeric value matching respective length, \code{grid::\link[grid]{unit}} object with matching respective length or \code{"auto"} for automatic relative proportions based on the number of levels for categorical variables.} -\item{legends}{deprecated} +\item{legends}{\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#deprecated}{\figure{lifecycle-deprecated.svg}{options: alt='[Deprecated]'}}}{\strong{[Deprecated]}}} } \value{ \code{\link{ggmatrix}} object that if called, will print diff --git a/tests/testthat/_snaps/gglegend/custom.new.svg b/tests/testthat/_snaps/gglegend/custom.new.svg new file mode 100644 index 000000000..0559e6b1c --- /dev/null +++ b/tests/testthat/_snaps/gglegend/custom.new.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + +Species + + + + + + +setosa +versicolor +virginica + + diff --git a/tests/testthat/_snaps/gglegend/internal-legend.new.svg b/tests/testthat/_snaps/gglegend/internal-legend.new.svg new file mode 100644 index 000000000..c4736e988 --- /dev/null +++ b/tests/testthat/_snaps/gglegend/internal-legend.new.svg @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Species + + + + + + +setosa +versicolor +virginica + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Sepal.Length + + + + + + + + + + +Sepal.Width + + + + + + + + + + +Sepal.Length + + + + + + + + + + +Sepal.Width + + + + + + +5 +6 +7 +8 + + + + + + +2.0 +2.5 +3.0 +3.5 +4.0 +4.5 +0.0 +0.4 +0.8 +1.2 + + + + +2.0 +2.5 +3.0 +3.5 +4.0 +4.5 + + + + + + + + diff --git a/tests/testthat/_snaps/gglegend/points.new.svg b/tests/testthat/_snaps/gglegend/points.new.svg new file mode 100644 index 000000000..e31be5156 --- /dev/null +++ b/tests/testthat/_snaps/gglegend/points.new.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + +Species + + + + + + +setosa +versicolor +virginica + + diff --git a/tests/testthat/_snaps/gglegend/pos-bottom.new.svg b/tests/testthat/_snaps/gglegend/pos-bottom.new.svg new file mode 100644 index 000000000..8427c0c29 --- /dev/null +++ b/tests/testthat/_snaps/gglegend/pos-bottom.new.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + +cut + + + + + + + + + + +Fair +Good +Very Good +Premium +Ideal + + diff --git a/tests/testthat/_snaps/gglegend/pos-left.new.svg b/tests/testthat/_snaps/gglegend/pos-left.new.svg new file mode 100644 index 000000000..ebabc09e6 --- /dev/null +++ b/tests/testthat/_snaps/gglegend/pos-left.new.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + +cut + + + + + + + + + + +Fair +Good +Very Good +Premium +Ideal + + diff --git a/tests/testthat/_snaps/gglegend/pos-right.new.svg b/tests/testthat/_snaps/gglegend/pos-right.new.svg new file mode 100644 index 000000000..ebabc09e6 --- /dev/null +++ b/tests/testthat/_snaps/gglegend/pos-right.new.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + +cut + + + + + + + + + + +Fair +Good +Very Good +Premium +Ideal + + diff --git a/tests/testthat/_snaps/gglegend/pos-top.new.svg b/tests/testthat/_snaps/gglegend/pos-top.new.svg new file mode 100644 index 000000000..8427c0c29 --- /dev/null +++ b/tests/testthat/_snaps/gglegend/pos-top.new.svg @@ -0,0 +1,39 @@ + + + + + + + + + + + + + +cut + + + + + + + + + + +Fair +Good +Very Good +Premium +Ideal + + diff --git a/tests/testthat/test-zzz_ggpairs.R b/tests/testthat/test-zzz_ggpairs.R index b99837ead..8154ea536 100644 --- a/tests/testthat/test-zzz_ggpairs.R +++ b/tests/testthat/test-zzz_ggpairs.R @@ -134,11 +134,10 @@ test_that("stops", { "'axisLabels' not in " ) # nolint - expect_warning( + lifecycle::expect_deprecated( { pm <- ggpairs(tips, color = "sex") }, - "Extra arguments: " ) # nolint expect_warning( @@ -167,18 +166,16 @@ test_that("stops", { "Columns in 'columnsY' not found in data" ) # nolint - expect_warning( + lifecycle::expect_deprecated( { pm <- ggpairs(tips, legends = TRUE) - }, - "'legends' will be deprecated" + } ) # nolint - expect_error( + lifecycle::expect_deprecated( { ggpairs(tips, params = c(size = 2)) - }, - "'params' is a deprecated" + } ) # nolint expect_error( From 759f5b64c845b2d2aa30cb930c72b18cbc37f3a8 Mon Sep 17 00:00:00 2001 From: Andrei Martins <92amartins@gmail.com> Date: Thu, 11 Apr 2024 12:10:07 -0300 Subject: [PATCH 2/5] Remove new snaps from gglegend --- tests/testthat/_snaps/gglegend/custom.new.svg | 33 -- .../_snaps/gglegend/internal-legend.new.svg | 386 ------------------ tests/testthat/_snaps/gglegend/points.new.svg | 33 -- .../_snaps/gglegend/pos-bottom.new.svg | 39 -- .../testthat/_snaps/gglegend/pos-left.new.svg | 39 -- .../_snaps/gglegend/pos-right.new.svg | 39 -- .../testthat/_snaps/gglegend/pos-top.new.svg | 39 -- 7 files changed, 608 deletions(-) delete mode 100644 tests/testthat/_snaps/gglegend/custom.new.svg delete mode 100644 tests/testthat/_snaps/gglegend/internal-legend.new.svg delete mode 100644 tests/testthat/_snaps/gglegend/points.new.svg delete mode 100644 tests/testthat/_snaps/gglegend/pos-bottom.new.svg delete mode 100644 tests/testthat/_snaps/gglegend/pos-left.new.svg delete mode 100644 tests/testthat/_snaps/gglegend/pos-right.new.svg delete mode 100644 tests/testthat/_snaps/gglegend/pos-top.new.svg diff --git a/tests/testthat/_snaps/gglegend/custom.new.svg b/tests/testthat/_snaps/gglegend/custom.new.svg deleted file mode 100644 index 0559e6b1c..000000000 --- a/tests/testthat/_snaps/gglegend/custom.new.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - -Species - - - - - - -setosa -versicolor -virginica - - diff --git a/tests/testthat/_snaps/gglegend/internal-legend.new.svg b/tests/testthat/_snaps/gglegend/internal-legend.new.svg deleted file mode 100644 index c4736e988..000000000 --- a/tests/testthat/_snaps/gglegend/internal-legend.new.svg +++ /dev/null @@ -1,386 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Species - - - - - - -setosa -versicolor -virginica - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Sepal.Length - - - - - - - - - - -Sepal.Width - - - - - - - - - - -Sepal.Length - - - - - - - - - - -Sepal.Width - - - - - - -5 -6 -7 -8 - - - - - - -2.0 -2.5 -3.0 -3.5 -4.0 -4.5 -0.0 -0.4 -0.8 -1.2 - - - - -2.0 -2.5 -3.0 -3.5 -4.0 -4.5 - - - - - - - - diff --git a/tests/testthat/_snaps/gglegend/points.new.svg b/tests/testthat/_snaps/gglegend/points.new.svg deleted file mode 100644 index e31be5156..000000000 --- a/tests/testthat/_snaps/gglegend/points.new.svg +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - -Species - - - - - - -setosa -versicolor -virginica - - diff --git a/tests/testthat/_snaps/gglegend/pos-bottom.new.svg b/tests/testthat/_snaps/gglegend/pos-bottom.new.svg deleted file mode 100644 index 8427c0c29..000000000 --- a/tests/testthat/_snaps/gglegend/pos-bottom.new.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - -cut - - - - - - - - - - -Fair -Good -Very Good -Premium -Ideal - - diff --git a/tests/testthat/_snaps/gglegend/pos-left.new.svg b/tests/testthat/_snaps/gglegend/pos-left.new.svg deleted file mode 100644 index ebabc09e6..000000000 --- a/tests/testthat/_snaps/gglegend/pos-left.new.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - -cut - - - - - - - - - - -Fair -Good -Very Good -Premium -Ideal - - diff --git a/tests/testthat/_snaps/gglegend/pos-right.new.svg b/tests/testthat/_snaps/gglegend/pos-right.new.svg deleted file mode 100644 index ebabc09e6..000000000 --- a/tests/testthat/_snaps/gglegend/pos-right.new.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - -cut - - - - - - - - - - -Fair -Good -Very Good -Premium -Ideal - - diff --git a/tests/testthat/_snaps/gglegend/pos-top.new.svg b/tests/testthat/_snaps/gglegend/pos-top.new.svg deleted file mode 100644 index 8427c0c29..000000000 --- a/tests/testthat/_snaps/gglegend/pos-top.new.svg +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - -cut - - - - - - - - - - -Fair -Good -Very Good -Premium -Ideal - - From 1fc3d59f6ae750e2d261308fb89068cbe911d9f7 Mon Sep 17 00:00:00 2001 From: Andrei Martins <92amartins@gmail.com> Date: Thu, 11 Apr 2024 12:45:40 -0300 Subject: [PATCH 3/5] Use check_dots_empty for dots deprecation in ggpairs --- R/ggpairs.R | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/R/ggpairs.R b/R/ggpairs.R index 5e0789a25..6a3cfe76c 100644 --- a/R/ggpairs.R +++ b/R/ggpairs.R @@ -780,14 +780,11 @@ ggpairs <- function( what = "ggpairs(params)" ) } - if(lifecycle::is_present(list(...))){ - lifecycle::deprecate_warn( - when = "2.2.2", - what = "ggpairs(...)" - ) + has_dots = rlang::check_dots_empty(error = function(cnd) TRUE) + if(isTRUE(has_dots)){ + lifecycle::deprecate_soft(when = "2.2.2", what = "ggpais(...)") } - isSharedData <- inherits(data, "SharedData") data_ <- fix_data(data) From ef766e6f2ff498af542ef7b1d97d2b911400d05e Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Fri, 12 Apr 2024 09:50:37 -0400 Subject: [PATCH 4/5] Lints --- R/ggpairs.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/R/ggpairs.R b/R/ggpairs.R index 6a3cfe76c..afbc6c69d 100644 --- a/R/ggpairs.R +++ b/R/ggpairs.R @@ -436,7 +436,7 @@ ggduo <- function( xProportions = NULL, yProportions = NULL, legends = deprecated()) { - if(lifecycle::is_present(legends)){ + if (lifecycle::is_present(legends)) { lifecycle::deprecate_warn( when = "2.2.2", what = "ggduo(legends)", @@ -767,21 +767,21 @@ ggpairs <- function( progress = NULL, proportions = NULL, legends = deprecated()) { - if(lifecycle::is_present(legends)){ + if (lifecycle::is_present(legends)) { lifecycle::deprecate_warn( when = "2.2.2", what = "ggpairs(legends)", details = "Ability to put legends in each plot will be dropped in next releases." ) } - if(lifecycle::is_present(params)){ + if (lifecycle::is_present(params)) { lifecycle::deprecate_warn( when = "2.2.2", what = "ggpairs(params)" ) } - has_dots = rlang::check_dots_empty(error = function(cnd) TRUE) - if(isTRUE(has_dots)){ + has_dots = rlang::check_dots_empty(error = function(cnd) {TRUE}) + if (isTRUE(has_dots)) { lifecycle::deprecate_soft(when = "2.2.2", what = "ggpais(...)") } From c91624f3bc3fdda42ab6aa8fecf44b3948cb2e1f Mon Sep 17 00:00:00 2001 From: Barret Schloerke Date: Fri, 12 Apr 2024 09:58:40 -0400 Subject: [PATCH 5/5] lint --- R/ggpairs.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/ggpairs.R b/R/ggpairs.R index afbc6c69d..b41419031 100644 --- a/R/ggpairs.R +++ b/R/ggpairs.R @@ -780,7 +780,9 @@ ggpairs <- function( what = "ggpairs(params)" ) } - has_dots = rlang::check_dots_empty(error = function(cnd) {TRUE}) + has_dots <- rlang::check_dots_empty(error = function(cnd) { + TRUE + }) if (isTRUE(has_dots)) { lifecycle::deprecate_soft(when = "2.2.2", what = "ggpais(...)") }