Skip to content

Commit a71583d

Browse files
committed
resolve merge conflict
Merge branch 'main' into fancy_ggproto_docs # Conflicts: # R/coord-.R # R/facet-.R # R/guide-.R # R/layer.R # man/ggplot2-ggproto.Rd
2 parents cec65c2 + 63ca94e commit a71583d

Some content is hidden

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

57 files changed

+1321
-23660
lines changed

DESCRIPTION

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: ggplot2
22
Title: Create Elegant Data Visualisations Using the Grammar of Graphics
3-
Version: 3.5.1.9000
3+
Version: 3.5.2.9000
44
Authors@R: c(
55
person("Hadley", "Wickham", , "[email protected]", role = "aut",
66
comment = c(ORCID = "0000-0003-4757-117X")),
@@ -31,7 +31,7 @@ URL: https://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2
3131
BugReports: https://github.com/tidyverse/ggplot2/issues
3232
Depends:
3333
R (>= 4.0)
34-
Imports:
34+
Imports:
3535
cli,
3636
grDevices,
3737
grid,
@@ -70,9 +70,9 @@ Suggests:
7070
tibble,
7171
vdiffr (>= 1.0.6),
7272
xml2
73-
Enhances:
73+
Enhances:
7474
sp
75-
VignetteBuilder:
75+
VignetteBuilder:
7676
knitr
7777
Config/Needs/website: ggtext, tidyr, forcats, tidyverse/tidytemplate
7878
Config/testthat/edition: 3
@@ -81,7 +81,7 @@ Encoding: UTF-8
8181
LazyData: true
8282
Roxygen: list(markdown = TRUE)
8383
RoxygenNote: 7.3.2
84-
Collate:
84+
Collate:
8585
'ggproto.R'
8686
'ggplot-global.R'
8787
'aaa-.R'

NAMESPACE

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -470,22 +470,26 @@ export(guide_transform)
470470
export(guides)
471471
export(has_flipped_aes)
472472
export(is.Coord)
473-
export(is.coord)
474473
export(is.facet)
475-
export(is.geom)
476474
export(is.ggplot)
477475
export(is.ggproto)
478-
export(is.guide)
479-
export(is.guides)
480-
export(is.layer)
481-
export(is.mapping)
482-
export(is.margin)
483-
export(is.position)
484-
export(is.scale)
485-
export(is.stat)
486476
export(is.theme)
487-
export(is.theme_element)
488477
export(is.waiver)
478+
export(is_coord)
479+
export(is_facet)
480+
export(is_geom)
481+
export(is_ggplot)
482+
export(is_ggproto)
483+
export(is_guide)
484+
export(is_guides)
485+
export(is_layer)
486+
export(is_mapping)
487+
export(is_margin)
488+
export(is_position)
489+
export(is_scale)
490+
export(is_stat)
491+
export(is_theme)
492+
export(is_theme_element)
489493
export(label_both)
490494
export(label_bquote)
491495
export(label_context)

NEWS.md

Lines changed: 841 additions & 827 deletions
Large diffs are not rendered by default.

R/aes.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ aes <- function(x, y, ...) {
111111

112112
#' @export
113113
#' @rdname is_tests
114-
is.mapping <- function(x) inherits(x, "uneval")
114+
is_mapping <- function(x) inherits(x, "uneval")
115115

116116
# Wrap symbolic objects in quosures but pull out constants out of
117117
# quosures for backward-compatibility

R/bin.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,15 +120,15 @@ compute_bins <- function(x, scale = NULL, breaks = NULL, binwidth = NULL, bins =
120120
center = NULL, boundary = NULL,
121121
closed = c("right", "left")) {
122122

123-
range <- if (is.scale(scale)) scale$dimension() else range(x)
123+
range <- if (is_scale(scale)) scale$dimension() else range(x)
124124
check_length(range, 2L)
125125

126126
if (!is.null(breaks)) {
127127
breaks <- allow_lambda(breaks)
128128
if (is.function(breaks)) {
129129
breaks <- breaks(x)
130130
}
131-
if (is.scale(scale) && !scale$is_discrete()) {
131+
if (is_scale(scale) && !scale$is_discrete()) {
132132
breaks <- scale$transform(breaks)
133133
}
134134
check_numeric(breaks)

R/coord-.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -689,14 +689,14 @@ Coord <- ggproto("Coord",
689689

690690
#' @export
691691
#' @rdname is_tests
692-
is.coord <- function(x) inherits(x, "Coord")
692+
is_coord <- function(x) inherits(x, "Coord")
693693

694694
#' @export
695695
#' @rdname is_tests
696696
#' @usage is.Coord(x) # Deprecated
697697
is.Coord <- function(x) {
698-
deprecate_soft0("3.5.2", "is.Coord()", "is.coord()")
699-
is.coord(x)
698+
deprecate_soft0("3.5.2", "is.Coord()", "is_coord()")
699+
is_coord(x)
700700
}
701701

702702
# Renders an axis with the correct orientation or zeroGrob if no axis should be

R/coord-cartesian-.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ view_scales_from_scale <- function(scale, coord_limits = NULL, expand = TRUE) {
165165
}
166166

167167
panel_guides_grob <- function(guides, position, theme, labels = NULL) {
168-
if (!is.guides(guides)) {
168+
if (!is_guides(guides)) {
169169
return(zeroGrob())
170170
}
171171
pair <- guides$get_position(position)

R/facet-.R

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ NULL
1111
#'
1212
#' @details
1313
#' Extending facets can range from the simple modifications of current facets,
14-
#' to very laborious rewrites with a lot of [gtable()] manipulation.
15-
#' For some examples of both, please see the extension vignette.
14+
#' to very laborious rewrites with a lot of [`gtable()`][gtable::gtable()]
15+
#' manipulation.For some examples of both, please see the extension vignette.
1616
#' The object and its parameters are chaperoned by the [Layout] class.
1717
#'
1818
#' `Facet` subclasses, like other extendible ggproto classes, have a range
@@ -424,7 +424,7 @@ Facet <- ggproto("Facet", NULL,
424424
#'
425425
#' **Value**
426426
#'
427-
#' A [gtable][gtable::gtable] object.
427+
#' A [`gtable`][gtable::gtable()] object.
428428
draw_panels = function(self, panels, layout, x_scales = NULL, y_scales = NULL,
429429
ranges, coord, data = NULL, theme, params) {
430430

@@ -482,7 +482,7 @@ Facet <- ggproto("Facet", NULL,
482482
#'
483483
#' **Value**
484484
#'
485-
#' A [gtable][gtable::gtable] object containing panel grobs prefixed with
485+
#' A [`gtable`][gtable::gtable()] object containing panel grobs prefixed with
486486
#' `"panel"`.
487487
init_gtable = function(panels, layout, theme, ranges, params,
488488
aspect_ratio = NULL) {
@@ -549,7 +549,7 @@ Facet <- ggproto("Facet", NULL,
549549
#' ```
550550
#' **Arguments**
551551
#' \describe{
552-
#' \item{`table`}{A [gtable][gtable()] object populated with panels from the
552+
#' \item{`table`}{A [`gtable`][gtable::gtable()] object populated with panels from the
553553
#' `init_gtable()` method.}
554554
#' \item{`layout`}{A data frame computed by the `compute_layout()` method.
555555
#' Typically contains the faceting variables, `ROW`, `COL`, `PANEL`,
@@ -564,7 +564,7 @@ Facet <- ggproto("Facet", NULL,
564564
#'
565565
#' **Value**
566566
#'
567-
#' A [gtable][gtable::gtable] object.
567+
#' A [`gtable`][gtable::gtable()] object.
568568
attach_axes = function(table, layout, ranges, coord, theme, params) {
569569
table
570570
},
@@ -582,7 +582,7 @@ Facet <- ggproto("Facet", NULL,
582582
#' ```
583583
#' **Arguments**
584584
#' \describe{
585-
#' \item{`table`}{A [gtable][gtable()] object from the `attach_axes()`
585+
#' \item{`table`}{A [`gtable`][gtable::gtable()] object from the `attach_axes()`
586586
#' method.}
587587
#' \item{`layout`}{A data frame computed by the `compute_layout()` method.
588588
#' Typically contains the faceting variables, `ROW`, `COL`, `PANEL`,
@@ -594,7 +594,7 @@ Facet <- ggproto("Facet", NULL,
594594
#'
595595
#' **Value**
596596
#'
597-
#' A [gtable][gtable::gtable] object.
597+
#' A [`gtable`][gtable::gtable()] object.
598598
attach_strips = function(table, layout, params, theme) {
599599
table
600600
},
@@ -638,7 +638,7 @@ Facet <- ggproto("Facet", NULL,
638638
#' ```
639639
#' **Arguments**
640640
#' \describe{
641-
#' \item{`table`}{A [gtable][gtable()] object populated by the
641+
#' \item{`table`}{A [`gtable`][gtable::gtable()] object populated by the
642642
#' `draw_panels()` method.}
643643
#' \item{`theme`}{A [complete theme][complete_theme()] object.}
644644
#' }
@@ -719,7 +719,7 @@ Facet <- ggproto("Facet", NULL,
719719
#' ```
720720
#' **Arguments**
721721
#' \describe{
722-
#' \item{`panels`}{A [gtable][gtable()] object initiated by the
722+
#' \item{`panels`}{A [`gtable`][gtable::gtable()] object initiated by the
723723
#' `draw_panels()` method.}
724724
#' \item{`layout`}{A data frame computed by the `compute_layout()` method.
725725
#' Typically contains the faceting variables, `ROW`, `COL`, `PANEL`,
@@ -739,7 +739,7 @@ Facet <- ggproto("Facet", NULL,
739739
#'
740740
#' **Value**
741741
#'
742-
#' A [gtable][gtable::gtable] object.
742+
#' A [`gtable`][gtable::gtable()] object.
743743
draw_labels = function(panels, layout, x_scales, y_scales, ranges, coord, data, theme, labels, params) {
744744
panel_dim <- find_panel(panels)
745745

@@ -789,10 +789,6 @@ Facet <- ggproto("Facet", NULL,
789789
}
790790
)
791791

792-
#' @export
793-
#' @rdname is_tests
794-
is.facet <- function(x) inherits(x, "Facet")
795-
796792
# Helpers -----------------------------------------------------------------
797793

798794
#' Quote faceting variables
@@ -854,6 +850,18 @@ vars <- function(...) {
854850
quos(...)
855851
}
856852

853+
#' @export
854+
#' @rdname is_tests
855+
is_facet <- function(x) inherits(x, "Facet")
856+
857+
#' @export
858+
#' @rdname is_tests
859+
#' @usage is.facet(x) # Deprecated
860+
is.facet <- function(x) {
861+
deprecate_soft0("3.5.2", "is.facet()", "is_facet()")
862+
is_facet(x)
863+
}
864+
857865
#' Accessing a plot's facet strip labels
858866
#'
859867
#' This functions retrieves labels from facet strips with the labeller applied.
@@ -964,7 +972,7 @@ as_facets_list <- function(x) {
964972
}
965973

966974
check_vars <- function(x) {
967-
if (is.mapping(x)) {
975+
if (is_mapping(x)) {
968976
cli::cli_abort("Please use {.fn vars} to supply facet variables.")
969977
}
970978
# Native pipe have higher precedence than + so any type of gg object can be

R/fortify.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ fortify.default <- function(model, data, ...) {
9494
"or an object coercible by {.fn fortify}, or a valid ",
9595
"{.cls data.frame}-like object coercible by {.fn as.data.frame}"
9696
)
97-
if (is.mapping(model)) {
97+
if (is_mapping(model)) {
9898
msg <- c(
9999
paste0(msg, ", not ", obj_type_friendly(model), "."),
100100
"i" = "Did you accidentally pass {.fn aes} to the {.arg data} argument?"

R/geom-.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ Geom <- ggproto(
465465

466466
#' @export
467467
#' @rdname is_tests
468-
is.geom <- function(x) inherits(x, "Geom")
468+
is_geom <- function(x) inherits(x, "Geom")
469469

470470
eval_from_theme <- function(aesthetics, theme, class = NULL) {
471471
themed <- is_themed_aes(aesthetics)

0 commit comments

Comments
 (0)