From 2941449294d2b0319d1b8e4a2f5ceeaa6320c76c Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Thu, 3 Apr 2025 15:44:36 +0200 Subject: [PATCH 1/3] fix typo --- R/coord-.R | 2 +- R/labels.R | 2 +- man/labs.Rd | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/coord-.R b/R/coord-.R index 0f2c0f3ca2..7e1682640e 100644 --- a/R/coord-.R +++ b/R/coord-.R @@ -206,7 +206,7 @@ Coord <- ggproto("Coord", #' @export #' @rdname is_tests -is_coord <- function(x) inheritS(x, "Coord") +is_coord <- function(x) inherits(x, "Coord") #' @export #' @rdname is_tests diff --git a/R/labels.R b/R/labels.R index c17a4f484d..72c6504732 100644 --- a/R/labels.R +++ b/R/labels.R @@ -110,7 +110,7 @@ ggtitle <- function(label, subtitle = waiver()) { #' @param plot A ggplot object #' @description #' `get_labs()` retrieves completed labels from a plot. -get_labs <- function(plot = get_last_plot()) { +get_labs <- function(plot = last_plot()) { plot <- ggplot_build(plot) labs <- plot$plot$labels diff --git a/man/labs.Rd b/man/labs.Rd index c6ee09e2c2..86b71a98aa 100644 --- a/man/labs.Rd +++ b/man/labs.Rd @@ -24,7 +24,7 @@ ylab(label) ggtitle(label, subtitle = waiver()) -get_labs(plot = get_last_plot()) +get_labs(plot = last_plot()) } \arguments{ \item{...}{A list of new name-value pairs. The name should be an aesthetic.} From a092c69ec2e0392b71f48d0d27e0c0322d58bc44 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Thu, 3 Apr 2025 15:54:23 +0200 Subject: [PATCH 2/3] fix offending example --- R/geom-defaults.R | 3 --- man/get_geom_defaults.Rd | 3 --- 2 files changed, 6 deletions(-) diff --git a/R/geom-defaults.R b/R/geom-defaults.R index ab681a51db..e41a0bd9f8 100644 --- a/R/geom-defaults.R +++ b/R/geom-defaults.R @@ -80,9 +80,6 @@ update_stat_defaults <- function(stat, new) { #' #' # Using a class #' get_geom_defaults(GeomPoint) -#' -#' # Changed theme -#' get_geom_defaults("point", theme(geom = element_geom(ink = "purple"))) get_geom_defaults <- function(geom, theme = theme_get()) { theme <- theme %||% list(geom = .default_geom_element) diff --git a/man/get_geom_defaults.Rd b/man/get_geom_defaults.Rd index a39f80d720..bd538eeda0 100644 --- a/man/get_geom_defaults.Rd +++ b/man/get_geom_defaults.Rd @@ -36,8 +36,5 @@ get_geom_defaults("density_2d") # Using a class get_geom_defaults(GeomPoint) - -# Changed theme -get_geom_defaults("point", theme(geom = element_geom(ink = "purple"))) } \keyword{internal} From 6943693c200cd5bfe5358383727dfc85548e27c9 Mon Sep 17 00:00:00 2001 From: Teun van den Brand Date: Thu, 3 Apr 2025 16:01:19 +0200 Subject: [PATCH 3/3] fix mistakes --- R/geom-defaults.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/geom-defaults.R b/R/geom-defaults.R index e41a0bd9f8..228194b4d2 100644 --- a/R/geom-defaults.R +++ b/R/geom-defaults.R @@ -81,12 +81,12 @@ update_stat_defaults <- function(stat, new) { #' # Using a class #' get_geom_defaults(GeomPoint) get_geom_defaults <- function(geom, theme = theme_get()) { - theme <- theme %||% list(geom = .default_geom_element) + theme <- theme %||% list() if (is.function(geom)) { geom <- geom() } - if (is.layer(geom)) { + if (is_layer(geom)) { data <- data_frame0(.id = 1L) data <- geom$compute_geom_2(data = data) data$.id <- NULL