diff --git a/DESCRIPTION b/DESCRIPTION index ca54ec260f..61a8ffa925 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: ggplot2 -Version: 3.2.0.9000 +Version: 3.2.1.9000 Title: Create Elegant Data Visualisations Using the Grammar of Graphics Description: A system for 'declaratively' creating graphics, based on "The Grammar of Graphics". You provide the data, tell 'ggplot2' diff --git a/NEWS.md b/NEWS.md index f3ab472b5a..384a50b645 100644 --- a/NEWS.md +++ b/NEWS.md @@ -55,6 +55,18 @@ * `stat_density2d()` can now take an `adjust` parameter to scale the default bandwidth. (#2860, @haleyjeppson) +# ggplot2 3.2.1 + +This is a patch release fixing a few regressions introduced in 3.2.0 as well as +fixing some unit tests that broke due to upstream changes. + +* `position_stack()` no longer changes the order of the input data. Changes to + the internal behaviour of `geom_ribbon()` made this reordering problematic + with ribbons that spanned `y = 0` (#3471) +* Using `qplot()` with a single positional aesthetic will no longer title the + non-specified scale as `"NULL"` (#3473) +* Fixes unit tests for sf graticule labels caused by chages to sf + # ggplot2 3.2.0 This is a minor release with an emphasis on internal changes to make ggplot2 diff --git a/R/position-stack.r b/R/position-stack.r index 0466a84919..7e42a8aef3 100644 --- a/R/position-stack.r +++ b/R/position-stack.r @@ -197,7 +197,7 @@ PositionStack <- ggproto("PositionStack", Position, ) } - rbind(neg, pos) + rbind(neg, pos)[match(seq_len(nrow(data)), c(which(negative), which(!negative))),] } ) diff --git a/R/quick-plot.r b/R/quick-plot.r index 5ecaaa71ba..81188e9474 100644 --- a/R/quick-plot.r +++ b/R/quick-plot.r @@ -71,13 +71,14 @@ qplot <- function(x, y, ..., data, facets = NULL, margins = FALSE, if (!missing(position)) warning("`position` is deprecated", call. = FALSE) if (!is.character(geom)) stop("`geom` must be a character vector", call. = FALSE) - exprs <- enquos(x = x, y = y, ..., .ignore_empty = "all") + exprs <- enquos(x = x, y = y, ...) + is_missing <- vapply(exprs, quo_is_missing, logical(1)) # treat arguments as regular parameters if they are wrapped into I() or # if they don't have a name that is in the list of all aesthetics is_constant <- (!names(exprs) %in% ggplot_global$all_aesthetics) | vapply(exprs, quo_is_call, logical(1), name = "I") - mapping <- new_aes(exprs[!is_constant], env = parent.frame()) + mapping <- new_aes(exprs[!is_missing & !is_constant], env = parent.frame()) consts <- exprs[is_constant] diff --git a/R/theme-defaults.r b/R/theme-defaults.r index bed61b6f7a..43fca0526b 100644 --- a/R/theme-defaults.r +++ b/R/theme-defaults.r @@ -22,7 +22,7 @@ #' #' \item{`theme_linedraw`}{ #' A theme with only black lines of various widths on white backgrounds, -#' reminiscent of a line drawings. Serves a purpose similar to `theme_bw`. +#' reminiscent of a line drawing. Serves a purpose similar to `theme_bw`. #' Note that this theme has some very thin lines (<< 1 pt) which some journals #' may refuse.} #' diff --git a/cran-comments.md b/cran-comments.md index d4e028bb78..bf2170e605 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,6 @@ -This is a resubmission with changes as requested by CRAN - -- Remove a subset of unit tests when running on CRAN to keep check time low +This is a patch release fixing the errors caused by changes to sf, as well as +fixing a few regressions. As all changes are internal and non-breaking a reverse +dependency check has not been performed ------- @@ -17,112 +17,3 @@ This is a resubmission with changes as requested by CRAN installed size is 6.2Mb sub-directories of 1Mb or more: doc 3.4Mb - -## revdepcheck results - -We checked 2675 reverse dependencies (2265 from CRAN + 410 from BioConductor), comparing R CMD check results across CRAN and dev versions of this package. - - * We saw 6 new problems - * We failed to check 76 packages - -Issues with CRAN packages are summarised below. The maintainers of the packages have been notified and most fixes are already on the way to CRAN. - -### New problems -(This reports the first line of each new failure) - -* bayesAB - checking examples ... ERROR - -* CSTools - checking tests ... - -* ggstatsplot - checking tests ... - -* HistDAWass - checking examples ... ERROR - -* MTLR - checking tests ... - -* vdiffr - checking tests ... - -### Failed to check - -* aslib (NA) -* BACA (NA) -* BACCT (NA) -* bamdit (NA) -* BayesRS (NA) -* BMSC (NA) -* BNSP (NA) -* BPEC (NA) -* bsam (NA) -* BTSPAS (NA) -* CaliCo (NA) -* CollapsABEL (NA) -* colorednoise (NA) -* crmPack (NA) -* Crossover (NA) -* Deducer (NA) -* DeLorean (NA) -* DiversityOccupancy (NA) -* dynfrail (NA) -* dynr (NA) -* evoper (NA) -* ewoc (NA) -* fingerPro (NA) -* fsdaR (NA) -* G2Sd (NA) -* growthPheno (NA) -* imageData (NA) -* imbalance (NA) -* InSilicoVA (NA) -* jarbes (NA) -* joineRML (NA) -* JointAI (NA) -* likeLTD (NA) -* lilikoi (NA) -* lime (NA) -* llama (NA) -* LLSR (NA) -* matchingMarkets (NA) -* mbgraphic (NA) -* mcmcabn (NA) -* MetaStan (NA) -* mleap (NA) -* morse (NA) -* mwaved (NA) -* NPflow (NA) -* oceanis (NA) -* OpenStreetMap (NA) -* openVA (NA) -* petro.One (NA) -* phase1PRMD (NA) -* phase1RMD (NA) -* pimeta (NA) -* poppr (NA) -* PortfolioEffectHFT (NA) -* qdap (NA) -* RcmdrPlugin.FuzzyClust (NA) -* Rdrools (NA) -* RDS (NA) -* rmcfs (NA) -* robustHD (NA) -* rpanel (NA) -* rpf (NA) -* rrepast (NA) -* RSCAT (NA) -* rstanarm (NA) -* rstap (NA) -* rsvg (NA) -* RtutoR (NA) -* SeqFeatR (NA) -* simmr (NA) -* sitmo (NA) -* spcosa (NA) -* TeachingDemos (NA) -* vortexR (NA) -* XLConnect (NA) -* zooaRchGUI (NA) diff --git a/man/ggtheme.Rd b/man/ggtheme.Rd index 800da29faa..46e01ac6b3 100644 --- a/man/ggtheme.Rd +++ b/man/ggtheme.Rd @@ -70,7 +70,7 @@ displayed with a projector.} \item{\code{theme_linedraw}}{ A theme with only black lines of various widths on white backgrounds, -reminiscent of a line drawings. Serves a purpose similar to \code{theme_bw}. +reminiscent of a line drawing. Serves a purpose similar to \code{theme_bw}. Note that this theme has some very thin lines (<< 1 pt) which some journals may refuse.} diff --git a/tests/testthat/test-position-stack.R b/tests/testthat/test-position-stack.R index f3be540a16..c889775df2 100644 --- a/tests/testthat/test-position-stack.R +++ b/tests/testthat/test-position-stack.R @@ -21,11 +21,11 @@ test_that("negative and positive values are handled separately", { p <- ggplot(df, aes(x, y, fill = factor(g))) + geom_col() dat <- layer_data(p) - expect_equal(dat$ymin[dat$x == 1], c(-1, 0, 1)) - expect_equal(dat$ymax[dat$x == 1], c(0, 1, 2)) + expect_equal(dat$ymin[dat$x == 1], c(0, -1, 1)) + expect_equal(dat$ymax[dat$x == 1], c(1, 0, 2)) - expect_equal(dat$ymin[dat$x == 2], c(-3, 0)) - expect_equal(dat$ymax[dat$x == 2], c(0, 2)) + expect_equal(dat$ymin[dat$x == 2], c(0, -3)) + expect_equal(dat$ymax[dat$x == 2], c(2, 0)) }) test_that("can request reverse stacking", { @@ -36,7 +36,7 @@ test_that("can request reverse stacking", { p <- ggplot(df, aes(1, y, fill = g)) + geom_col(position = position_stack(reverse = TRUE)) dat <- layer_data(p) - expect_equal(dat$ymin, c(-2, -3, 0, 2)) + expect_equal(dat$ymin, c(-2, 0, -3, 2)) }) test_that("data with no extent is stacked correctly", {