From f4b2dab997c307da52cd3dcf77cc534bba0dabbb Mon Sep 17 00:00:00 2001 From: Teun van den Brand <49372158+teunbrand@users.noreply.github.com> Date: Tue, 1 Aug 2023 21:25:44 +0200 Subject: [PATCH 1/4] Fix version comparison (#5376) * Reimplement #5367 * Override default density method --- NEWS.md | 5 +++++ R/backports.R | 4 ++-- tests/testthat/helper-density.R | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 tests/testthat/helper-density.R diff --git a/NEWS.md b/NEWS.md index 97bfe9195d..cdeb15f022 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# ggplot2 3.4.3 + +This hotfix release addresses a version comparison change in r-devel. There are +no user-facing or breaking changes. + # ggplot2 3.4.2 This is a hotfix release anticipating changes in r-devel, but folds in upkeep changes and a few bug fixes as well. diff --git a/R/backports.R b/R/backports.R index 7dea54cd3a..549a80f2c9 100644 --- a/R/backports.R +++ b/R/backports.R @@ -1,6 +1,6 @@ # Backport fix from R 3.3: # https://github.com/wch/r-source/commit/4efc81c98d262f93de9e7911aaa910f5c63cd00f -if (getRversion() < 3.3) { +if (getRversion() < "3.3") { absolute.units <- getFromNamespace("absolute.units", "grid") absolute.units.unit <- getFromNamespace("absolute.units.unit", "grid") absolute.units.unit.list <- getFromNamespace("absolute.units.unit.list", "grid") @@ -18,6 +18,6 @@ if (getRversion() < 3.3) { on_load(backport_unit_methods()) # isFALSE() is available on R (>=3.5) -if (getRversion() < 3.5) { +if (getRversion() < "3.5") { isFALSE <- function(x) is.logical(x) && length(x) == 1L && !is.na(x) && !x } diff --git a/tests/testthat/helper-density.R b/tests/testthat/helper-density.R new file mode 100644 index 0000000000..1896437b8f --- /dev/null +++ b/tests/testthat/helper-density.R @@ -0,0 +1,21 @@ + +# In R devel from 4.3.0 onwards, the density calculation has slightly changed, +# which affects visual snapshots that use a density calculation, like +# `geom_violin()` and `geom_density()`. +# See https://developer.r-project.org/blosxom.cgi/R-devel/NEWS/2023/05/03#n2023-05-03 +# +# It has a backwards compatibility argument called 'old.coords' that can be used +# to perform the classic density calculation, which means we can stably use +# visual tests in R devel. +# +# Since that argument is not available in older versions, we have to use the +# following workaround. Here, we conditionally override the default +# density method to use `old.coords = TRUE`. +if ("old.coords" %in% names(formals(stats::density.default))) { + registerS3method( + "density", "default", + function(..., old.coords = TRUE) { + stats::density.default(..., old.coords = old.coords) + } + ) +} From 72b891feed36001da966d6580636114945525b37 Mon Sep 17 00:00:00 2001 From: Teun van den Brand <49372158+teunbrand@users.noreply.github.com> Date: Tue, 1 Aug 2023 21:47:01 +0200 Subject: [PATCH 2/4] update cran-comments.md --- cran-comments.md | 78 ++++-------------------------------------------- 1 file changed, 5 insertions(+), 73 deletions(-) diff --git a/cran-comments.md b/cran-comments.md index 2a13d28867..15f70e610b 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,73 +1,5 @@ -This is a patch release responding to a request from CRAN about new warnings in -R-devel. It also includes a small batch of of bug fixes since last release. -There are no user facing changes. - -All breaking reverse dependencies have been notified. - -## revdepcheck results - -We checked 4503 reverse dependencies (4468 from CRAN + 35 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package. - - * We saw 8 new problems - * We failed to check 29 packages - -Issues with CRAN packages are summarised below. - -### New problems -(This reports the first line of each new failure) - -* afex - checking re-building of vignette outputs ... WARNING - -* dalmatian - checking re-building of vignette outputs ... WARNING - -* DriveML - checking re-building of vignette outputs ... WARNING - -* EcoEnsemble - checking re-building of vignette outputs ... WARNING - -* ggtern - checking Rd files ... WARNING - -* siland - checking re-building of vignette outputs ... WARNING - -* TCIU - checking re-building of vignette outputs ... WARNING - -* xpose - checking tests ... ERROR - -### Failed to check - -* beadplexr (NA) -* CausalImpact (NA) -* CensMFM (NA) -* cinaR (NA) -* ctsem (NA) -* genekitr (NA) -* ggh4x (NA) -* glmmPen (NA) -* grandR (NA) -* immcp (NA) -* loon.ggplot (NA) -* MACP (NA) -* MarketMatching (NA) -* MARVEL (NA) -* nlmixr2rpt (NA) -* numbat (NA) -* OlinkAnalyze (NA) -* OpenMx (NA) -* Platypus (NA) -* PsychWordVec (NA) -* RcppCensSpatial (NA) -* rstan (NA) -* RVA (NA) -* rxode2 (NA) -* SCpubr (NA) -* tidySEM (NA) -* tinyarray (NA) -* valse (NA) -* vivid (NA) +This is a patch release responding to a request from CRAN about numeric +version comparisons in R-devel. It also includes a workaround for changes +in the `stats::density()` function in R-devel that affected visual tests. +There are no user facing changes, so no reverse dependencies are expected to +be affected. From 6bc0a7f3e722d1f0f40f832ac7650e606e9b158b Mon Sep 17 00:00:00 2001 From: Teun van den Brand <49372158+teunbrand@users.noreply.github.com> Date: Mon, 7 Aug 2023 20:05:56 +0200 Subject: [PATCH 3/4] Increment version number to 3.4.3 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6e7fded4bf..42a0fb0007 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: ggplot2 -Version: 3.4.2 +Version: 3.4.3 Title: Create Elegant Data Visualisations Using the Grammar of Graphics Authors@R: c( person("Hadley", "Wickham", , "hadley@posit.co", role = "aut", From e89befcb4788ab053c761ff24099139e4e6a8f5b Mon Sep 17 00:00:00 2001 From: Thomas Lin Pedersen Date: Mon, 14 Aug 2023 14:16:45 +0200 Subject: [PATCH 4/4] Update version --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 42a0fb0007..29f664380e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: ggplot2 -Version: 3.4.3 +Version: 3.4.3.9000 Title: Create Elegant Data Visualisations Using the Grammar of Graphics Authors@R: c( person("Hadley", "Wickham", , "hadley@posit.co", role = "aut", diff --git a/NEWS.md b/NEWS.md index cdeb15f022..7e09b43dad 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# ggplot2 (development version) + # ggplot2 3.4.3 This hotfix release addresses a version comparison change in r-devel. There are