Skip to content

Commit bf0c64f

Browse files
teunbrandyutannihilationthomasp85matthewjnield
authored
Merge in v3.4.4 to main (#5480)
* Cherry-pick from #5327 * Add a NEWS item * Hotfix 3.4.4 (#5449) * is.atomic() --> is.atomic() || is.null() * Polish news * Put is.null() first * Cherrypick rgeos removal from description (#5453) * Remove rgeos from the dependency (#5242) --------- Co-authored-by: Hiroaki Yutani <[email protected]> * run revdepcheck * Update CRAN comments * Increment version number to 3.4.4 * Fix Version 3.4.4 NEWS Typo (#5479) Change "the upcoming retirement of rproj, rgeos, and maptools" to "the upcoming retirement of rgdal, rgeos, and maptools" * Increment version number to 3.4.4.9000 --------- Co-authored-by: Hiroaki Yutani <[email protected]> Co-authored-by: Thomas Lin Pedersen <[email protected]> Co-authored-by: Matt Nield <[email protected]>
1 parent 6dd9bb6 commit bf0c64f

File tree

12 files changed

+2971
-1579
lines changed

12 files changed

+2971
-1579
lines changed

DESCRIPTION

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: ggplot2
2-
Version: 3.4.3.9000
2+
Version: 3.4.4.9000
33
Title: Create Elegant Data Visualisations Using the Grammar of Graphics
44
Authors@R: c(
55
person("Hadley", "Wickham", , "[email protected]", role = "aut",
@@ -54,7 +54,6 @@ Suggests:
5454
knitr,
5555
mapproj,
5656
maps,
57-
maptools,
5857
multcomp,
5958
munsell,
6059
nlme,

NEWS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@
155155
duplicated coordinates (@teunbrand, #5215).
156156
* Improve performance of layers without positional scales (@zeehio, #4990)
157157

158+
# ggplot2 3.4.4
159+
160+
This hotfix release adapts to a change in r-devel's `base::is.atomic()` and
161+
the upcoming retirement of maptools.
162+
163+
* `fortify()` for sp objects (e.g., `SpatialPolygonsDataFrame`) is now deprecated
164+
and will be removed soon in support of [the upcoming retirement of rgdal, rgeos,
165+
and maptools](https://r-spatial.org/r/2023/05/15/evolution4.html). In advance
166+
of the whole removal, `fortify(<SpatialPolygonsDataFrame>, region = ...)`
167+
no longer works as of this version (@yutannihilation, #5244).
168+
158169
# ggplot2 3.4.3
159170
This hotfix release addresses a version comparison change in r-devel. There are
160171
no user-facing or breaking changes.

R/aes-evaluation.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ is_calculated <- function(x, warn = FALSE) {
226226
return(TRUE)
227227
}
228228
# Support of old recursive behaviour
229-
if (is.atomic(x)) {
229+
if (is.null(x) || is.atomic(x)) {
230230
FALSE
231231
} else if (is.symbol(x)) {
232232
res <- is_dotted_var(as.character(x))
@@ -266,7 +266,7 @@ is_staged <- function(x) {
266266

267267
# Strip dots from expressions
268268
strip_dots <- function(expr, env, strip_pronoun = FALSE) {
269-
if (is.atomic(expr)) {
269+
if (is.null(expr) || is.atomic(expr)) {
270270
expr
271271
} else if (is.name(expr)) {
272272
expr_ch <- as.character(expr)
@@ -324,7 +324,7 @@ strip_stage <- function(expr) {
324324
make_labels <- function(mapping) {
325325
default_label <- function(aesthetic, mapping) {
326326
# e.g., geom_smooth(aes(colour = "loess")) or aes(y = NULL)
327-
if (is.atomic(mapping)) {
327+
if (is.null(mapping) || is.atomic(mapping)) {
328328
return(aesthetic)
329329
}
330330
mapping <- strip_stage(mapping)

R/aes.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ aes_ <- function(x, y, ...) {
285285
as_quosure_aes <- function(x) {
286286
if (is.formula(x) && length(x) == 2) {
287287
as_quosure(x)
288-
} else if (is.call(x) || is.name(x) || is.atomic(x)) {
288+
} else if (is.null(x) || is.call(x) || is.name(x) || is.atomic(x)) {
289289
new_aesthetic(x, caller_env)
290290
} else {
291291
cli::cli_abort("Aesthetic must be a one-sided formula, call, name, or constant.")

R/fortify-spatial.R

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,31 @@
99
#' @param ... not used by this method
1010
#' @keywords internal
1111
#' @name fortify.sp
12-
#' @examples
13-
#' if (require("maptools")) {
14-
#' sids <- system.file("shapes/sids.shp", package="maptools")
15-
#' nc1 <- readShapePoly(sids,
16-
#' proj4string = CRS("+proj=longlat +datum=NAD27"))
17-
#' nc1_df <- fortify(nc1)
18-
#' }
1912
NULL
2013

2114
#' @rdname fortify.sp
2215
#' @export
2316
#' @method fortify SpatialPolygonsDataFrame
2417
fortify.SpatialPolygonsDataFrame <- function(model, data, region = NULL, ...) {
18+
deprecate_warn0("3.4.4",
19+
I("`fortify(<SpatialPolygonsDataFrame>)`"),
20+
details = "Please migrate to sf."
21+
)
22+
2523
attr <- as.data.frame(model)
2624
# If not specified, split into regions based on polygons
2725
if (is.null(region)) {
28-
coords <- lapply(model@polygons,fortify)
26+
# Suppress duplicated warnings
27+
withr::with_options(list(lifecycle_verbosity = "quiet"), {
28+
coords <- lapply(model@polygons,fortify)
29+
})
2930
coords <- vec_rbind0(!!!coords)
3031
cli::cli_inform("Regions defined for each Polygons")
3132
} else {
32-
cp <- sp::polygons(model)
33-
34-
# Union together all polygons that make up a region
35-
unioned <- maptools::unionSpatialPolygons(cp, attr[, region])
36-
coords <- fortify(unioned)
37-
coords$order <- 1:nrow(coords)
33+
lifecycle::deprecate_stop("3.4.4",
34+
I("`fortify(<SpatialPolygonsDataFrame>, region = ...)` is defunct'"),
35+
details = "Please migrate to sf."
36+
)
3837
}
3938
coords
4039
}
@@ -43,14 +42,27 @@ fortify.SpatialPolygonsDataFrame <- function(model, data, region = NULL, ...) {
4342
#' @export
4443
#' @method fortify SpatialPolygons
4544
fortify.SpatialPolygons <- function(model, data, ...) {
46-
polys <- lapply(model@polygons, fortify)
45+
deprecate_warn0("3.4.4",
46+
I("`fortify(<SpatialPolygons>)`"),
47+
details = "Please migrate to sf."
48+
)
49+
50+
# Suppress duplicated warnings
51+
withr::with_options(list(lifecycle_verbosity = "quiet"), {
52+
polys <- lapply(model@polygons, fortify)
53+
})
4754
vec_rbind0(!!!polys)
4855
}
4956

5057
#' @rdname fortify.sp
5158
#' @export
5259
#' @method fortify Polygons
5360
fortify.Polygons <- function(model, data, ...) {
61+
deprecate_warn0("3.4.4",
62+
I("`fortify(<Polygons>)`"),
63+
details = "Please migrate to sf."
64+
)
65+
5466
subpolys <- model@Polygons
5567
pieces <- lapply(seq_along(subpolys), function(i) {
5668
df <- fortify(subpolys[[model@plotOrder[i]]])
@@ -70,6 +82,11 @@ fortify.Polygons <- function(model, data, ...) {
7082
#' @export
7183
#' @method fortify Polygon
7284
fortify.Polygon <- function(model, data, ...) {
85+
deprecate_warn0("3.4.4",
86+
I("`fortify(<Polygon>)`"),
87+
details = "Please migrate to sf."
88+
)
89+
7390
df <- as.data.frame(model@coords)
7491
names(df) <- c("long", "lat")
7592
df$order <- 1:nrow(df)
@@ -81,6 +98,11 @@ fortify.Polygon <- function(model, data, ...) {
8198
#' @export
8299
#' @method fortify SpatialLinesDataFrame
83100
fortify.SpatialLinesDataFrame <- function(model, data, ...) {
101+
deprecate_warn0("3.4.4",
102+
I("`fortify(<SpatialLinesDataFrame>)`"),
103+
details = "Please migrate to sf."
104+
)
105+
84106
lines <- lapply(model@lines, fortify)
85107
vec_rbind0(!!!lines)
86108
}
@@ -89,6 +111,11 @@ fortify.SpatialLinesDataFrame <- function(model, data, ...) {
89111
#' @export
90112
#' @method fortify Lines
91113
fortify.Lines <- function(model, data, ...) {
114+
deprecate_warn0("3.4.4",
115+
I("`fortify(<Lines>)`"),
116+
details = "Please migrate to sf."
117+
)
118+
92119
lines <- model@Lines
93120
pieces <- lapply(seq_along(lines), function(i) {
94121
df <- fortify(lines[[i]])
@@ -108,6 +135,11 @@ fortify.Lines <- function(model, data, ...) {
108135
#' @export
109136
#' @method fortify Line
110137
fortify.Line <- function(model, data, ...) {
138+
deprecate_warn0("3.4.4",
139+
I("`fortify(<Line>)`"),
140+
details = "Please migrate to sf."
141+
)
142+
111143
df <- as.data.frame(model@coords)
112144
names(df) <- c("long", "lat")
113145
df$order <- 1:nrow(df)

cran-comments.md

Lines changed: 66 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,66 @@
1-
This is a patch release responding to a request from CRAN about numeric
2-
version comparisons in R-devel. It also includes a workaround for changes
3-
in the `stats::density()` function in R-devel that affected visual tests.
4-
There are no user facing changes, so no reverse dependencies are expected to
5-
be affected.
1+
This is a patch release responding to changes in R-devel concerning the behavior
2+
of `is.atomic()`. Further, it contains the removal of maptools and rgeos which
3+
is set for archival soon
4+
5+
## revdepcheck results
6+
7+
We checked 4771 reverse dependencies (4716 from CRAN + 55 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package.
8+
9+
* We saw 2 new problems
10+
* We failed to check 42 packages
11+
12+
Issues with CRAN packages are summarised below.
13+
14+
### New problems
15+
(This reports the first line of each new failure)
16+
17+
* jfa
18+
checking re-building of vignette outputs ... WARNING
19+
20+
* SCORPIUS
21+
checking tests ... ERROR
22+
23+
### Failed to check
24+
25+
* ale (NA)
26+
* aPEAR (NA)
27+
* bayesdfa (NA)
28+
* BrailleR (NA)
29+
* CausalImpact (NA)
30+
* CensMFM (NA)
31+
* cinaR (NA)
32+
* fdacluster (NA)
33+
* genekitr (NA)
34+
* ggPMX (NA)
35+
* grandR (NA)
36+
* HeckmanEM (NA)
37+
* immcp (NA)
38+
* loon.ggplot (NA)
39+
* MACP (NA)
40+
* MarketMatching (NA)
41+
* MARVEL (NA)
42+
* MSclassifR (NA)
43+
* nlmixr2 (NA)
44+
* nlmixr2extra (NA)
45+
* nlmixr2plot (NA)
46+
* nlmixr2rpt (NA)
47+
* numbat (NA)
48+
* oHMMed (NA)
49+
* OlinkAnalyze (NA)
50+
* OpenMx (NA)
51+
* phylosem (NA)
52+
* PsychWordVec (NA)
53+
* RcppCensSpatial (NA)
54+
* rmsb (NA)
55+
* rstanarm (NA)
56+
* RVA (NA)
57+
* SCpubr (NA)
58+
* SSVS (NA)
59+
* streamDAG (NA)
60+
* TestAnaAPP (NA)
61+
* tidySEM (NA)
62+
* tinyarray (NA)
63+
* TOmicsVis (NA)
64+
* valse (NA)
65+
* vivid (NA)
66+
* xpose.nlmixr2 (NA)

man/fortify.sp.Rd

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)