Skip to content

Commit fda95e1

Browse files
committed
use add_class() in other places too
1 parent 8ac14d6 commit fda95e1

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

R/aes-variants.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,7 @@ aes_all <- function(vars) {
113113
# Quosure the symbols in the empty environment because they can only
114114
# refer to the data mask
115115
x <- class_mapping(lapply(vars, function(x) new_quosure(as.name(x), emptyenv())))
116-
class(x) <- union("unlabelled", class(x))
117-
x
116+
add_class(x, "unlabelled")
118117
}
119118

120119
#' Automatic aesthetic mapping

R/theme.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,7 @@ theme <- function(...,
501501
}
502502

503503
t <- class_theme(elements, complete = complete, validate = validate)
504-
class(t) <- union("theme", class(t))
504+
t <- add_class(t, "theme")
505505
t
506506
}
507507

0 commit comments

Comments
 (0)