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()) {
209209 }
210210
211211 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+ )
213216 # Native pipe have higher precedence than + so any type of gg object can be
214217 # expected here, not just ggplot
215218 if (S7 :: S7_inherits(mapping , class_gg )) {
Original file line number Diff line number Diff line change @@ -116,11 +116,8 @@ ggplot <- function(
116116ggplot.default <-
117117 function (data , mapping = aes(), ... , environment = parent.frame()) {
118118
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 )
124121 }
125122 if (missing(data )) {
126123 data <- NULL
You can’t perform that action at this time.
0 commit comments