Description
In some reverse dependency checks, it has become clear that some +
methods no longer work as intended. I had already struggled to find a solution for this problem in GGally. It has come up in these packages, as far as I recall:
- GGally
- ggside
- feasts
- gggenomes
And is also reported for nlmixr2plot (#6498 (comment)).
I'm not sure what the optimal solution is for this case. I don't think using S7's double dispatch is the immediate solution, in particular because it has trouble dispatching on S3 classes in some cases (see also RConsortium/S7#544). One option could be to also implement the S3 class as an S7 class, in which case the S7 double dispatch becomes viable.
In GGally's case, the custom LHS S3 class included "gg"
and the RHS in e.g. labs()
also has an S3 "gg"
class for legacy reasons. In this case, overriding +.gg
worked but that may not be the case for every type of class.