ggplot2
ggplot2 copied to clipboard
default_aes not used in compute_*() methods
While writing about extensions I noticed that the content of default_aes in a stat is not added to the data before it is passed through the compute_*() mill. This effectively renders it useless for anything but defining mappings for the geom.
The current code reflects this as it has all sorts of code around extracting non-required aesthetics from the data, e.g. in StatBinHex
https://github.com/tidyverse/ggplot2/blob/1223de2d6841be4276b5b398aff747672797c1b9/R/stat-binhex.r#L45-L65
we set a default weight, but still has to guard it with data$weight %||% rep(1L, nrow(data)) when using it in compute_group()
I cannot see any meaningful reason why this is so, and the fix seems obvious. Have I missed an underlying reason @hadley?