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/geom-defaults.R b/R/geom-defaults.R index ab681a51db..228194b4d2 100644 --- a/R/geom-defaults.R +++ b/R/geom-defaults.R @@ -80,16 +80,13 @@ 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) + 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 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/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} 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.}