Skip to content

Revdep: bridging + methods #6504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
teunbrand opened this issue Jun 11, 2025 · 2 comments
Open

Revdep: bridging + methods #6504

teunbrand opened this issue Jun 11, 2025 · 2 comments

Comments

@teunbrand
Copy link
Collaborator

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

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.

@billdenney
Copy link
Contributor

@teunbrand, the issue you raised in the linked S7 repo seems to be exactly the one that I'm experiencing with nlmixr2plot. If the package can use chooseOpsMethod, then it works for my ggtibble package. That may be a general solution.

@teunbrand
Copy link
Collaborator Author

teunbrand commented Jun 11, 2025

Yeah I'm aware of that function ever since you mentioned it in #5536 (comment), but I can't seem to figure out how to make this work with the S7 methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants