diff --git a/NEWS.md b/NEWS.md index 4c0ea1e891..285399407e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # ggplot2 (development version) +* 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 diff --git a/R/labels.R b/R/labels.R index 2bc5551034..7662153e91 100644 --- a/R/labels.R +++ b/R/labels.R @@ -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