Motivation
An issue from 2019 has been there for a while, after I have done the major part of the color_off
feature, I got some free time and decided to look into that.
Development Log
This still credited to the debug tool. After loading namespace ggplot2, the Layer object calls this plyr defaults() function to compute aesthetics, which generate a list of quosure with expr
and env
causing the error. I think it is probably because the [.quosures
or c.quosures
S3 methods are overwritten by ggplot2 in this case.
Browse[2]> defaults(layers[[1]]$mapping, plot$mapping)
$x
<quosure>
expr: ^waiting
env: global
$y
<quosure>
expr: ^eruptions
env: global
$z
<quosure>
expr: ^density
env: global
And in the latest ggplot2, instead of importing from plyr, they copied some plyr functions inside ggplot package, including defaults()
, so I did the same thing.