You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to make add_ggplot as an S3 generic?
Currently we have to resort to overwriting "+.gg" if we want to adopt a different method based on the class of e1, e.g. GGally is a prime example of this. This allows developers to fix issues like #4304 .
The fix, as below, will be relatively simple, but the downside is that you do have to export another function.
I still believe this should be solved by utilizing double dispatch (probably with vctrs integration), but, considering I (or we) have failed to implement it for this 2 years, we might need to rethink.
I think @emitanaka's proposal is a reasonable fix. R7 should eventually get to the point where the double dispatch will just work but that's at least a few years away, and using vctrs would be a bit of a hack since ggplot2 objects aren't vectors. @schloerke's PR looks good to be, so I'll going to close this issue as a duplicate of #3986.
Would it be possible to make
add_ggplot
as an S3 generic?Currently we have to resort to overwriting
"+.gg"
if we want to adopt a different method based on the class ofe1
, e.g.GGally
is a prime example of this. This allows developers to fix issues like #4304 .The fix, as below, will be relatively simple, but the downside is that you do have to export another function.
The text was updated successfully, but these errors were encountered: