File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -209,7 +209,10 @@ validate_mapping <- function(mapping, call = caller_env()) {
209
209
}
210
210
211
211
if (! is_mapping(mapping )) {
212
- msg <- " {.arg mapping} must be created by {.fn aes}."
212
+ msg <- c(
213
+ " {.arg mapping} must be created by {.fn aes}." ,
214
+ " x" = " You've supplied {.obj_type_friendly {mapping}}."
215
+ )
213
216
# Native pipe have higher precedence than + so any type of gg object can be
214
217
# expected here, not just ggplot
215
218
if (S7 :: S7_inherits(mapping , class_gg )) {
Original file line number Diff line number Diff line change @@ -116,11 +116,8 @@ ggplot <- function(
116
116
ggplot.default <-
117
117
function (data , mapping = aes(), ... , environment = parent.frame()) {
118
118
119
- if (! missing(mapping ) && ! is_mapping(mapping )) {
120
- cli :: cli_abort(c(
121
- " {.arg mapping} must be created with {.fn aes}." ,
122
- " x" = " You've supplied {.obj_type_friendly {mapping}}."
123
- ))
119
+ if (! missing(mapping )) {
120
+ mapping <- validate_mapping(mapping )
124
121
}
125
122
if (missing(data )) {
126
123
data <- NULL
You can’t perform that action at this time.
0 commit comments