Skip to content

Commit 0f7d790

Browse files
teunbrandthomasp85
andauthored
Polishes triggered by revdep failures (#6506)
* don't extract <element_blank>@hjust * ensure `if` switch is scalar * contingency where `merge_element(..., e2 = <S3_element>)` * cast a wider net for function matching * Fix NOTE: no visible binding for global variable 'properties' * stabilise missingness detection for 2D structures * avoid recursion issue when `theme` is missing * avoid renaming argument for S3 method consistency purposes * demote warning to message * stop complaints about 0-length labels, which is commonly used in label supression * allow merging <S3> + <S3> * fix #6521 * fix #6513 * avoid rare error when using GeomSf based extensions * `label.size` should be soft-deprecated first * put `convert` into `local()` too * restore accent colour for `geom_contour()` * new revdepcheck * don't prepend `""` as class * mark the binning change as a breaking change * fix #6531 * fix #6529 * no longer soft-deprecated * attempt to tone down spurious warnings * fallback for translating `geom_errorbarh(height)` * alias to prevent breaking linking docs * avoid `rel(0)` margins, fix #6536 * last attempt at removing rownames * use logical NA for casting purposes --------- Co-authored-by: Thomas Lin Pedersen <thomasp85@gmail.com>
1 parent d5ff3a6 commit 0f7d790

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1019
-10541
lines changed

NEWS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
rather than in the layer method of `update_ggplot()`
2626
(previously `ggplot_add.Layer()`). This may affect code that accessed the
2727
`plot$labels` property (@teunbrand, #5894).
28+
* In binning stats, the default `boundary` is now chosen to better adhere to
29+
the `nbin` argument. This may affect plots that use default binning
30+
(@teunbrand, #5882, #5036)
2831

2932
### Lifecycle changes
3033

@@ -218,8 +221,6 @@
218221
aesthetics (@teunbrand, #2800, #3142, #5740, #3722).
219222
* All binning stats now use the `boundary`/`center` parametrisation rather
220223
than `origin`, following in `stat_bin()`'s footsteps (@teunbrand).
221-
* In `stat_bin()`, the default `boundary` is now chosen to better adhere to
222-
the `nbin` argument (@teunbrand, #5882, #5036)
223224
* Reintroduced `drop` argument to `stat_bin()` (@teunbrand, #3449)
224225
* `stat_bin()` now accepts functions for argument `breaks` (@aijordan, #4561)
225226
* `after_stat()` and `after_scale()` throw warnings when the computed aesthetics

R/aes.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ is_position_aes <- function(vars) {
261261
#'
262262
#' @section Life cycle:
263263
#'
264-
#' All these functions are soft-deprecated. Please use tidy evaluation idioms
264+
#' All these functions are deprecated. Please use tidy evaluation idioms
265265
#' instead. Regarding `aes_string()`, you can replace it with `.data` pronoun.
266266
#' For example, the following code can achieve the same mapping as
267267
#' `aes_string(x_var, y_var)`.

R/compat-plyr.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,17 @@ unrowname <- function(x) {
1919
} else if (is.matrix(x)) {
2020
dimnames(x)[1] <- list(NULL)
2121
} else {
22-
cli::cli_abort("Can only remove rownames from {.cls data.frame} and {.cls matrix} objects.")
22+
try_fetch(
23+
{
24+
rownames(x) <- NULL
25+
},
26+
error = function(cnd) {
27+
cli::cli_abort(
28+
"Can only remove rownames from {.cls data.frame} and {.cls matrix} objects.",
29+
parent = cnd
30+
)
31+
}
32+
)
2333
}
2434
x
2535
}

R/coord-radial.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ coord_radial <- function(theta = "x",
136136
}
137137
if (lifecycle::is_present(direction)) {
138138
deprecate_warn0(
139-
"3.5.2", "coord_radial(direction)", "coord_radial(reverse)"
139+
"4.0.0", "coord_radial(direction)", "coord_radial(reverse)"
140140
)
141141
reverse <- switch(reverse, "r" = "thetar", "theta")
142142
}

R/coord-transform.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ coord_transform <- function(x = "identity", y = "identity", xlim = NULL, ylim =
113113
#' @export
114114
coord_trans <- function(...) {
115115
deprecate_soft0(
116-
"3.5.2",
116+
"4.0.0",
117117
"coord_trans()",
118118
"coord_transform()"
119119
)

R/facet-wrap.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ wrap_layout <- function(id, dims, dir) {
569569
# Should only occur when `as.table` was not incorporated into `dir`
570570
dir <- switch(dir, h = "lt", v = "tl")
571571
deprecate_soft0(
572-
"3.5.2",
572+
"4.0.0",
573573
what = I("Internal use of `dir = \"h\"` and `dir = \"v\"` in `facet_wrap()`"),
574574
details = I(c(
575575
"The `dir` argument should incorporate the `as.table` argument.",

R/geom-boxplot.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ GeomBoxplot <- ggproto("GeomBoxplot", Geom,
241241
setup_params = function(data, params) {
242242
if ("fatten" %in% names(params)) {
243243
deprecate_soft0(
244-
"3.6.0", "geom_boxplot(fatten)",
244+
"4.0.0", "geom_boxplot(fatten)",
245245
"geom_boxplot(median.linewidth)"
246246
)
247247
} else {

R/geom-contour.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
#' @include geom-path.R
66
GeomContour <- ggproto(
77
"GeomContour", GeomPath,
8-
default_aes = aes(weight = 1, !!!GeomPath$default_aes)
8+
default_aes = aes(
9+
weight = 1,
10+
colour = from_theme(colour %||% accent),
11+
linewidth = from_theme(linewidth),
12+
linetype = from_theme(linetype),
13+
alpha = NA
14+
)
915
)
1016

1117
#' @rdname Geom

R/geom-crossbar.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ GeomCrossbar <- ggproto("GeomCrossbar", Geom,
6262
setup_params = function(data, params) {
6363
if (lifecycle::is_present(params$fatten %||% deprecated())) {
6464
deprecate_soft0(
65-
"3.6.0", "geom_crossbar(fatten)",
65+
"4.0.0", "geom_crossbar(fatten)",
6666
"geom_crossbar(middle.linewidth)"
6767
)
6868
} else {

R/geom-density.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ GeomDensity <- ggproto(
7676
#' geom_density(position = "fill")
7777
#' }
7878
geom_density <- make_constructor(
79-
GeomDensity, stat = "density",
79+
GeomDensity, stat = "density", outline.type = "upper",
8080
checks = exprs(
8181
outline.type <- arg_match0(outline.type, c("both", "upper", "lower", "full"))
8282
)

0 commit comments

Comments
 (0)