Skip to content

Commit e214e44

Browse files
authored
make sure aes renaming is reflected in data (#3733)
1 parent b869f0e commit e214e44

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

R/layer.r

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,11 @@ Layer <- ggproto("Layer", NULL,
280280
map_statistic = function(self, data, plot) {
281281
if (empty(data)) return(new_data_frame())
282282

283+
# Make sure data columns are converted to correct names. If not done, a
284+
# column with e.g. a color name will not be found in an after_stat()
285+
# evaluation (since the evaluation symbols gets renamed)
286+
data <- rename_aes(data)
287+
283288
# Assemble aesthetics from layer, plot and stat mappings
284289
aesthetics <- self$mapping
285290
if (self$inherit.aes) {

0 commit comments

Comments
 (0)