Skip to content

Commit 1d79f7e

Browse files
committed
Link to default theme and treat new being null as new being missing.
1 parent 43a05da commit 1d79f7e

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

R/theme-current.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,10 @@ get_theme <- function() {
9191
theme_get <- get_theme
9292

9393
#' @rdname get_theme
94-
#' @param new new theme (a list of theme elements). Sets theme to the default (theme_grey) if `new` isn't supplied.
94+
#' @param new new theme (a list of theme elements). Sets theme to the default ([theme_grey()]) if `new` isn't supplied.
9595
#' @export
9696
set_theme <- function(new) {
97-
if (missing(new)) {
98-
new <- ggplot_global$theme_default
99-
}
97+
new <- new %||% ggplot_global$theme_default
10098
check_object(new, is_theme, "a {.cls theme} object")
10199
old <- ggplot_global$theme_current
102100
ggplot_global$theme_current <- new

man/get_theme.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)