Skip to content

Commit 8875ff8

Browse files
committed
resolve merge conflict
Merge branch 'main' into bump_deprecations # Conflicts: # R/stat-bin.R
2 parents 06677bc + 1bfb3c9 commit 8875ff8

File tree

422 files changed

+9642
-4333
lines changed

Some content is hidden

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

422 files changed

+9642
-4333
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
cache-version: 3
6464
extra-packages: >
6565
any::rcmdcheck,
66-
Hmisc=?ignore-before-r=4.1.0,
66+
Hmisc=?ignore-before-r=4.2.0,
6767
quantreg=?ignore-before-r=4.3.0
6868
needs: check
6969

DESCRIPTION

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: ggplot2
2-
Version: 3.5.1.9000
32
Title: Create Elegant Data Visualisations Using the Grammar of Graphics
3+
Version: 3.5.1.9000
44
Authors@R: c(
55
person("Hadley", "Wickham", , "[email protected]", role = "aut",
66
comment = c(ORCID = "0000-0003-4757-117X")),
@@ -30,21 +30,21 @@ License: MIT + file LICENSE
3030
URL: https://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2
3131
BugReports: https://github.com/tidyverse/ggplot2/issues
3232
Depends:
33-
R (>= 3.5)
33+
R (>= 4.0)
3434
Imports:
3535
cli,
3636
grDevices,
3737
grid,
3838
gtable (>= 0.1.1),
3939
isoband,
4040
lifecycle (> 1.0.1),
41-
MASS,
4241
rlang (>= 1.1.0),
4342
scales (>= 1.3.0),
4443
stats,
4544
vctrs (>= 0.6.0),
4645
withr (>= 2.5.0)
4746
Suggests:
47+
broom,
4848
covr,
4949
dplyr,
5050
ggplot2movies,
@@ -53,6 +53,7 @@ Suggests:
5353
knitr,
5454
mapproj,
5555
maps,
56+
MASS,
5657
mgcv,
5758
multcomp,
5859
munsell,
@@ -75,6 +76,7 @@ VignetteBuilder:
7576
knitr
7677
Config/Needs/website: ggtext, tidyr, forcats, tidyverse/tidytemplate
7778
Config/testthat/edition: 3
79+
Config/usethis/last-upkeep: 2024-10-24
7880
Encoding: UTF-8
7981
LazyData: true
8082
Roxygen: list(markdown = TRUE)
@@ -125,15 +127,15 @@ Collate:
125127
'facet-grid-.R'
126128
'facet-null.R'
127129
'facet-wrap.R'
128-
'fortify-lm.R'
129130
'fortify-map.R'
130-
'fortify-multcomp.R'
131+
'fortify-models.R'
131132
'fortify-spatial.R'
132133
'fortify.R'
133134
'stat-.R'
134135
'geom-abline.R'
135136
'geom-rect.R'
136137
'geom-bar.R'
138+
'geom-tile.R'
137139
'geom-bin2d.R'
138140
'geom-blank.R'
139141
'geom-boxplot.R'
@@ -150,7 +152,6 @@ Collate:
150152
'geom-density2d.R'
151153
'geom-dotplot.R'
152154
'geom-errorbar.R'
153-
'geom-errorbarh.R'
154155
'geom-freqpoly.R'
155156
'geom-function.R'
156157
'geom-hex.R'
@@ -167,7 +168,6 @@ Collate:
167168
'geom-smooth.R'
168169
'geom-spoke.R'
169170
'geom-text.R'
170-
'geom-tile.R'
171171
'geom-violin.R'
172172
'geom-vline.R'
173173
'ggplot2-package.R'
@@ -242,6 +242,7 @@ Collate:
242242
'scales-.R'
243243
'stat-align.R'
244244
'stat-bin.R'
245+
'stat-summary-2d.R'
245246
'stat-bin2d.R'
246247
'stat-bindot.R'
247248
'stat-binhex.R'
@@ -254,6 +255,7 @@ Collate:
254255
'stat-ellipse.R'
255256
'stat-function.R'
256257
'stat-identity.R'
258+
'stat-manual.R'
257259
'stat-qq-line.R'
258260
'stat-qq.R'
259261
'stat-quantilemethods.R'
@@ -262,7 +264,6 @@ Collate:
262264
'stat-smooth-methods.R'
263265
'stat-smooth.R'
264266
'stat-sum.R'
265-
'stat-summary-2d.R'
266267
'stat-summary-bin.R'
267268
'stat-summary-hex.R'
268269
'stat-summary.R'
@@ -273,6 +274,7 @@ Collate:
273274
'theme.R'
274275
'theme-defaults.R'
275276
'theme-current.R'
277+
'theme-sub.R'
276278
'utilities-break.R'
277279
'utilities-grid.R'
278280
'utilities-help.R'

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT License
22

3-
Copyright (c) 2020 ggplot2 authors
3+
Copyright (c) 2024 ggplot2 core developer team
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

NAMESPACE

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ S3method(c,mapped_discrete)
2020
S3method(drawDetails,zeroGrob)
2121
S3method(element_grob,element_blank)
2222
S3method(element_grob,element_line)
23+
S3method(element_grob,element_point)
24+
S3method(element_grob,element_polygon)
2325
S3method(element_grob,element_rect)
2426
S3method(element_grob,element_text)
2527
S3method(format,ggproto)
@@ -94,6 +96,7 @@ S3method(makeContext,dotstackGrob)
9496
S3method(merge_element,default)
9597
S3method(merge_element,element)
9698
S3method(merge_element,element_blank)
99+
S3method(merge_element,margin)
97100
S3method(pattern_alpha,GridPattern)
98101
S3method(pattern_alpha,GridTilingPattern)
99102
S3method(pattern_alpha,default)
@@ -172,6 +175,7 @@ export(GeomAbline)
172175
export(GeomAnnotationMap)
173176
export(GeomArea)
174177
export(GeomBar)
178+
export(GeomBin2d)
175179
export(GeomBlank)
176180
export(GeomBoxplot)
177181
export(GeomCol)
@@ -263,6 +267,7 @@ export(StatEcdf)
263267
export(StatEllipse)
264268
export(StatFunction)
265269
export(StatIdentity)
270+
export(StatManual)
266271
export(StatQq)
267272
export(StatQqLine)
268273
export(StatQuantile)
@@ -343,6 +348,8 @@ export(element_blank)
343348
export(element_geom)
344349
export(element_grob)
345350
export(element_line)
351+
export(element_point)
352+
export(element_polygon)
346353
export(element_rect)
347354
export(element_render)
348355
export(element_text)
@@ -461,7 +468,6 @@ export(guides)
461468
export(has_flipped_aes)
462469
export(is.Coord)
463470
export(is.coord)
464-
export(is.element)
465471
export(is.facet)
466472
export(is.geom)
467473
export(is.ggplot)
@@ -475,6 +481,8 @@ export(is.position)
475481
export(is.scale)
476482
export(is.stat)
477483
export(is.theme)
484+
export(is.theme_element)
485+
export(is.waiver)
478486
export(label_both)
479487
export(label_bquote)
480488
export(label_context)
@@ -492,6 +500,8 @@ export(layer_sf)
492500
export(lims)
493501
export(map_data)
494502
export(margin)
503+
export(margin_auto)
504+
export(margin_part)
495505
export(max_height)
496506
export(max_width)
497507
export(mean_cl_boot)
@@ -686,6 +696,7 @@ export(stat_ecdf)
686696
export(stat_ellipse)
687697
export(stat_function)
688698
export(stat_identity)
699+
export(stat_manual)
689700
export(stat_qq)
690701
export(stat_qq_line)
691702
export(stat_quantile)
@@ -718,7 +729,19 @@ export(theme_linedraw)
718729
export(theme_minimal)
719730
export(theme_replace)
720731
export(theme_set)
732+
export(theme_sub_axis)
733+
export(theme_sub_axis_bottom)
734+
export(theme_sub_axis_left)
735+
export(theme_sub_axis_right)
736+
export(theme_sub_axis_top)
737+
export(theme_sub_axis_x)
738+
export(theme_sub_axis_y)
739+
export(theme_sub_legend)
740+
export(theme_sub_panel)
741+
export(theme_sub_plot)
742+
export(theme_sub_strip)
721743
export(theme_test)
744+
export(theme_transparent)
722745
export(theme_update)
723746
export(theme_void)
724747
export(transform_position)

NEWS.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,98 @@
44
of warnings.
55
* Functions and arguments that were soft-deprecated up to ggplot2 3.2.0 now
66
throw warnings.
7+
* New parameters for `geom_label()` (@teunbrand and @steveharoz, #5365):
8+
* The `linewidth` aesthetic is now applied and replaces the `label.size`
9+
argument.
10+
* The `linetype` aesthetic is now applied.
11+
* New `border.colour` argument to set the colour of borders.
12+
* New `text.colour` argument to set the colour of text.
13+
* New `element_point()` and `element_polygon()` that can be given to
14+
`theme(point, polygon)` as an extension point (@teunbrand, #6248).
15+
* Turned off fallback for `size` to `linewidth` translation in
16+
`geom_bar()`/`geom_col()` (#4848).
17+
* `coord_radial()` now displays no axis instead of throwing an error when
18+
a scale has no breaks (@teunbrand, #6271).
19+
* The `fatten` argument has been deprecated in `geom_boxplot()`,
20+
`geom_crossbar()` and `geom_pointrange()` (@teunbrand, #4881).
21+
* Axis labels are now preserved better when using `coord_sf(expand = TRUE)` and
22+
graticule lines are straight but do not meet the edge (@teunbrand, #2985).
23+
* Attempt to boost detail in `coord_polar()` and `coord_radial()` near the
24+
center (@teunbrand, #5023)
25+
* Scale names, guide titles and aesthetic labels can now accept functions
26+
(@teunbrand, #4313)
27+
* Binned scales with zero-width data expand the default limits by 0.1
28+
(@teunbrand, #5066)
29+
* New default `geom_qq_line(geom = "abline")` for better clipping in the
30+
vertical direction. In addition, `slope` and `intercept` are new computed
31+
variables in `stat_qq_line()` (@teunbrand, #6087).
32+
* Position adjustments can now have auxiliary aesthetics (@teunbrand).
33+
* `position_nudge()` gains `nudge_x` and `nudge_y` aesthetics (#3026, #5445).
34+
* `position_dodge()` gains `order` aesthetic (#3022, #3345)
35+
* More stability for vctrs-based palettes (@teunbrand, #6117).
36+
* Fixed regression in `guide_bins(reverse = TRUE)` (@teunbrand, #6183).
37+
* New function family for setting parts of a theme. For example, you can now use
38+
`theme_sub_axis(line, text, ticks, ticks.length, line)` as a substitute for
39+
`theme(axis.line, axis.text, axis.ticks, axis.ticks.length, axis.line)`. This
40+
should allow slightly terser and more organised theme declarations
41+
(@teunbrand, #5301).
42+
* `scale_{x/y}_discrete(continuous.limits)` is a new argument to control the
43+
display range of discrete scales (@teunbrand, #4174, #6259).
44+
* `geom_ribbon()` now appropriately warns about, and removes, missing values
45+
(@teunbrand, #6243).
46+
* `guide_*()` can now accept two inside legend theme elements:
47+
`legend.position.inside` and `legend.justification.inside`, allowing inside
48+
legends to be placed at different positions. Only inside legends with the same
49+
position and justification will be merged (@Yunuuuu, #6210).
50+
* New stat: `stat_manual()` for arbitrary computations (@teunbrand, #3501)
51+
* Reversal of a dimension, typically 'x' or 'y', is now controlled by the
52+
`reverse` argument in `coord_cartesian()`, `coord_fixed()`, `coord_radial()`
53+
and `coord_sf()`. In `coord_radial()`, this replaces the older `direction`
54+
argument (#4021, @teunbrand).
55+
* `coord_radial()` displays minor gridlines now (@teunbrand).
56+
* (internal) `continuous_scale()` and `binned_scale()` sort the `limits`
57+
argument internally (@teunbrand).
58+
* Theme margins can have NA-units to inherit from parent elements. The new
59+
function `margin_part()` has NA-units as default (@teunbrand, #6115)
60+
* New `margin_auto()` specification for theme margins.
61+
* New argument `labs(dictionary)` to label based on variable name rather than
62+
based on aesthetic (@teunbrand, #5178)
63+
* Fixed bug in out-of-bounds binned breaks (@teunbrand, #6054)
64+
* Binned guides now accept expressions as labels (@teunbrand, #6005)
65+
* (internal) `Scale$get_labels()` format expressions as lists.
66+
* In non-orthogonal coordinate systems (`coord_sf()`, `coord_polar()` and
67+
`coord_radial()`), using 'AsIs' variables escape transformation when
68+
both `x` and `y` is an 'AsIs' variable (@teunbrand, #6205).
69+
* The following methods have been deprecated: `fortify.lm()`, `fortify.glht()`,
70+
`fortify.confint.glht()`, `fortify.summary.glht()` and `fortify.cld()`. It
71+
is recommend to use `broom::augment()` and `broom::tidy()` instead
72+
(@teunbrand, #3816).
73+
* Custom and raster annotation now respond to scale transformations, and can
74+
use AsIs variables for relative placement (@teunbrand based on
75+
@yutannihilation's prior work, #3120)
76+
* When discrete breaks have names, they'll be used as labels by default
77+
(@teunbrand, #6147).
78+
* The helper function `is.waiver()` is now exported to help extensions to work
79+
with `waiver()` objects (@arcresu, #6173).
80+
* Date(time) scales now throw appropriate errors when `date_breaks`,
81+
`date_minor_breaks` or `date_labels` are not strings (@RodDalBen, #5880)
82+
* `geom_errorbarh()` is deprecated in favour of
83+
`geom_errorbar(orientation = "y")` (@teunbrand, #5961).
84+
* `geom_contour()` should be able to recognise a rotated grid of points
85+
(@teunbrand, #4320)
86+
* `geom_boxplot()` gains additional arguments to style the colour, linetype and
87+
linewidths of the box, whiskers, median line and staples (@teunbrand, #5126)
88+
* `geom_violin()` gains additional arguments to style the colour, linetype and
89+
linewidths of the quantiles, which replace the now-deprecated `draw_quantiles`
90+
argument (#5912).
91+
* (breaking) `geom_violin(quantiles)` now has actual quantiles based on
92+
the data, rather than inferred quantiles based on the computed density. The
93+
`quantiles` parameter that replaces `draw_quantiles` now belongs to
94+
`stat_ydensity()` instead of `geom_violin()` (@teunbrand, #4120).
95+
* (internal) Using `after_scale()` in the `Geom*$default_aes()` field is now
96+
evaluated in the context of data (@teunbrand, #6135)
97+
* Fixed bug where binned scales wouldn't simultaneously accept transformations
98+
and function-limits (@teunbrand, #6144).
799
* Fixed bug where the `ggplot2::`-prefix did not work with `stage()`
8100
(@teunbrand, #6104).
9101
* New `get_labs()` function for retrieving completed plot labels
@@ -188,6 +280,36 @@
188280
* The ellipsis argument is now checked in `fortify()`, `get_alt_text()`,
189281
`labs()` and several guides (@teunbrand, #3196).
190282
* `stat_summary_bin()` no longer ignores `width` parameter (@teunbrand, #4647).
283+
* Reintroduced `drop` argument to `stat_bin()` (@teunbrand, #3449)
284+
* (internal) removed barriers for using 2D structures as aesthetics
285+
(@teunbrand, #4189).
286+
* `coord_sf()` no longer errors when dealing with empty graticules (@teunbrand, #6052)
287+
* Added `theme_transparent()` with transparent backgrounds (@topepo).
288+
* New theme elements `palette.{aes}.discrete` and `palette.{aes}.continuous`.
289+
Theme palettes replace palettes in scales where `palette = NULL`, which is
290+
the new default in many scales (@teunbrand, #4696).
291+
* `guide_axis()` no longer reserves space for blank ticks
292+
(@teunbrand, #4722, #6069).
293+
* `geom_abline()` clips to the panel range in the vertical direction too
294+
(@teunbrand, #6086).
295+
* Added `panel.widths` and `panel.heights` to `theme()` (#5338, @teunbrand).
296+
* Standardised the calculation of `width`, which are now implemented as
297+
aesthetics (@teunbrand, #2800).
298+
* Stricter check on `register_theme_elements(element_tree)` (@teunbrand, #6162)
299+
* Added `weight` aesthetic for `stat_ellipse()` (@teunbrand, #5272)
300+
* Fixed a bug where the `guide_custom(order)` wasn't working (@teunbrand, #6195)
301+
* All binning stats now use the `boundary`/`center` parametrisation rather
302+
than `origin`, following in `stat_bin()`'s footsteps (@teunbrand).
303+
* `stat_summary_2d()` and `stat_bin_2d()` now deal with zero-range data
304+
more elegantly (@teunbrand, #6207).
305+
* Munching in `coord_polar()` and `coord_radial()` now adds more detail,
306+
particularly for data-points with a low radius near the center
307+
(@teunbrand, #5023).
308+
* All scales now expose the `aesthetics` parameter (@teunbrand, #5841)
309+
* New `theme(legend.key.justification)` to control the alignment of legend keys
310+
(@teunbrand, #3669).
311+
* Added `scale_{x/y}_time(date_breaks, date_minor_breaks, date_labels)`
312+
(@teunbrand, #4335).
191313

192314
# ggplot2 3.5.1
193315

@@ -234,6 +356,7 @@ documentation updates.
234356
* `annotate()` now warns about `stat` or `position` arguments (@teunbrand, #5151)
235357
* `guide_coloursteps(even.steps = FALSE)` now works with discrete data that has
236358
been formatted by `cut()` (@teunbrand, #3877).
359+
* `ggsave()` now offers to install svglite if needed (@eliocamp, #6166).
237360

238361
# ggplot2 3.5.0
239362

R/aes.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ NULL
3838
#'
3939
#' [Delayed evaluation][aes_eval] for working with computed variables.
4040
#'
41+
#' @note
42+
#' Using `I()` to create objects of class 'AsIs' causes scales to ignore the
43+
#' variable and assumes the wrapped variable is direct input for the grid
44+
#' package. Please be aware that variables are sometimes combined, like in
45+
#' some stats or position adjustments, that may yield unexpected results with
46+
#' 'AsIs' variables.
47+
#'
4148
#' @family aesthetics documentation
4249
#' @return A list with class `uneval`. Components of the list are either
4350
#' quosures or constants.

0 commit comments

Comments
 (0)