Skip to content

Commit a9ffcb0

Browse files
authored
Allow using optional_aes in Stat (#4002)
1 parent 0f725e1 commit a9ffcb0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/stat-.r

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ Stat <- ggproto("Stat",
6161

6262
non_missing_aes = character(),
6363

64+
optional_aes = character(),
65+
6466
setup_params = function(data, params) {
6567
params
6668
},
@@ -155,7 +157,7 @@ Stat <- ggproto("Stat",
155157
} else {
156158
required_aes <- unlist(strsplit(self$required_aes, '|', fixed = TRUE))
157159
}
158-
c(union(required_aes, names(self$default_aes)), "group")
160+
c(union(required_aes, names(self$default_aes)), self$optional_aes, "group")
159161
}
160162

161163
)

0 commit comments

Comments
 (0)