Skip to content

Commit

Permalink
Merge branch 'main' into geomsf-updateshape
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 authored Aug 15, 2024
2 parents d74642a + 308d4c3 commit 57ba39a
Show file tree
Hide file tree
Showing 51 changed files with 153 additions and 53 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ggplot2 (development version)

* geom_sf now accepts shape names (@sierrajohnson, #5808)
* Added `gg` class to `labs()` (@phispu, #5553).
* Missing values from discrete palettes are no longer translated
(@teunbrand, #5929).
* Fixed bug in `facet_grid(margins = TRUE)` when using expresssions
Expand Down
2 changes: 1 addition & 1 deletion R/geom-smooth.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' `predictdf()` generic and its methods. For most methods the standard
#' error bounds are computed using the [predict()] method -- the
#' exceptions are `loess()`, which uses a t-based approximation, and
#' `glm()`, where the normal confidence interval is constructed on the link
#' `glm()`, where the normal confidence band is constructed on the link
#' scale and then back-transformed to the response scale.
#'
#' @eval rd_orientation()
Expand Down
5 changes: 4 additions & 1 deletion R/labeller.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@
#' # Interpreting the labels as plotmath expressions
#' p + facet_grid(. ~ cyl2)
#' p + facet_grid(. ~ cyl2, labeller = label_parsed)
#'
#' # Include optional argument in label function
#' p + facet_grid(. ~ cyl, labeller = function(x) label_both(x, sep = "="))
#' }
#' @name labellers
NULL
Expand Down Expand Up @@ -320,7 +323,7 @@ as_labeller <- function(x, default = label_value, multi_line = TRUE) {
#'
#' This function makes it easy to assign different labellers to
#' different factors. The labeller can be a function or it can be a
#' named character vectors that will serve as a lookup table.
#' named character vector that will serve as a lookup table.
#'
#' In case of functions, if the labeller has class `labeller`, it
#' is directly applied on the data frame of labels. Otherwise, it is
Expand Down
2 changes: 1 addition & 1 deletion R/labels.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ labs <- function(..., title = waiver(), subtitle = waiver(), caption = waiver(),
args <- args[!duplicated(names(args))]
args <- rename_aes(args)

structure(args, class = "labels")
structure(args, class = c("labels", "gg"))
}

#' @rdname labs
Expand Down
4 changes: 3 additions & 1 deletion R/layer.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@
#' `NA`, the default, includes if any aesthetics are mapped.
#' `FALSE` never includes, and `TRUE` always includes.
#' It can also be a named logical vector to finely select the aesthetics to
#' display.
#' display. To include legend keys for all levels, even
#' when no data exists, use `TRUE`. If `NA`, all levels are shown in legend,
#' but unobserved levels are omitted.
#' @param inherit.aes If `FALSE`, overrides the default aesthetics,
#' rather than combining with them. This is most useful for helper functions
#' that define both data and aesthetics and shouldn't inherit behaviour from
Expand Down
1 change: 1 addition & 0 deletions R/stat-density.R
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ reflect_density <- function(dens, bounds, from, to) {
precompute_bw = function(x, bw = "nrd0") {
bw <- bw[1]
if (is.character(bw)) {
bw <- to_lower_ascii(bw)
bw <- arg_match0(bw, c("nrd0", "nrd", "ucv", "bcv", "sj", "sj-ste", "sj-dpi"))
bw <- switch(
to_lower_ascii(bw),
Expand Down
8 changes: 4 additions & 4 deletions R/stat-smooth.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
#' `y ~ poly(x, 2)`, `y ~ log(x)`. `NULL` by default, in which case
#' `method = NULL` implies `formula = y ~ x` when there are fewer than 1,000
#' observations and `formula = y ~ s(x, bs = "cs")` otherwise.
#' @param se Display confidence interval around smooth? (`TRUE` by default, see
#' @param se Display confidence band around smooth? (`TRUE` by default, see
#' `level` to control.)
#' @param fullrange If `TRUE`, the smoothing line gets expanded to the range of the plot,
#' potentially beyond the data. This does not extend the line into any additional padding
#' created by `expansion`.
#' @param xseq A numeric vector of values at which the smoother is evaluated.
#' When `NULL` (default), `xseq` is internally evaluated as a sequence of `n`
#' equally spaced points for continuous data.
#' @param level Level of confidence interval to use (0.95 by default).
#' @param level Level of confidence band to use (0.95 by default).
#' @param span Controls the amount of smoothing for the default loess smoother.
#' Smaller numbers produce wigglier lines, larger numbers produce smoother
#' lines. Only used with loess, i.e. when `method = "loess"`,
Expand All @@ -40,8 +40,8 @@
#' .details = "`stat_smooth()` provides the following variables, some of
#' which depend on the orientation:",
#' "y|x" = "Predicted value.",
#' "ymin|xmin" = "Lower pointwise confidence interval around the mean.",
#' "ymax|xmax" = "Upper pointwise confidence interval around the mean.",
#' "ymin|xmin" = "Lower pointwise confidence band around the mean.",
#' "ymax|xmax" = "Upper pointwise confidence band around the mean.",
#' "se" = "Standard error."
#' )
#' @export
Expand Down
3 changes: 3 additions & 0 deletions R/utilities-break.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
#' table(cut_width(runif(1000), 0.1, center = 0))
#' table(cut_width(runif(1000), 0.1, labels = FALSE))
cut_interval <- function(x, n = NULL, length = NULL, ...) {
if ((!is.null(n) && !is.null(length)) || (is.null(n) && is.null(length))) {
cli::cli_abort("Specify exactly one of {.var n} and {.var length}.")
}
cut(x, breaks(x, "width", n, length), include.lowest = TRUE, ...)
}

Expand Down
4 changes: 3 additions & 1 deletion man/borders.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_abline.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_bar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_bin_2d.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_blank.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_boxplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_contour.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_count.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_density.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_density_2d.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_dotplot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_errorbarh.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_function.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_hex.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_histogram.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_jitter.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_linerange.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_map.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_path.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_point.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_polygon.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_qq.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_quantile.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/geom_ribbon.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 57ba39a

Please sign in to comment.