Skip to content

Commit 47557c8

Browse files
committed
recover from S3 mappings
1 parent 027b074 commit 47557c8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

R/layer.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ layer <- function(geom = NULL, stat = NULL,
200200
}
201201

202202
validate_mapping <- function(mapping, call = caller_env()) {
203+
# Upgrade any old S3 input to new S7 input
204+
# TODO: deprecate this after a while
205+
if (inherits(mapping, "uneval") && is.list(mapping)) {
206+
mapping <- aes(!!!mapping)
207+
}
208+
203209
if (!is_mapping(mapping)) {
204210
msg <- "{.arg mapping} must be created by {.fn aes}."
205211
# Native pipe have higher precedence than + so any type of gg object can be

0 commit comments

Comments
 (0)