Skip to content

Feature request: Make %+% into an S3 generic #6221

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

Closed
billdenney opened this issue Dec 8, 2024 · 2 comments
Closed

Feature request: Make %+% into an S3 generic #6221

billdenney opened this issue Dec 8, 2024 · 2 comments

Comments

@billdenney
Copy link
Contributor

In situations when I'm using the ggtibble package, I want to be able to use any operations that can occur on a gg object on a ggtibble and gglist object.

I would like to be able to use %+% on a ggtibble object, but it is not generic, so I can't easily use it. If package load order is ggtibble then ggplot2, the ggplot2 %+%function will be used instead of a generic fromggtibble`.

@billdenney billdenney changed the title Make %+% into an S3 generic Feature request: Make %+% into an S3 generic Dec 8, 2024
@teunbrand
Copy link
Collaborator

Hi there, thanks for the suggestion! This has been suggested before in #5536 (comment). The larger issue of encoding custom behaviour for custom classes of ggplot2-like object has been discusssed in #3815. The reasoning at the time was that we don't want to export %+% as a generic, as we should solve this problem with proper double dispatch. S4 was excluded due to its rigity and S7 was entertained for a while. A proof of concept was coined in #5537, but we felt S7 wasn't ready yet. In any case, to keep all related discussion in one place, I'm going to close this issue in favour of #5536.

@billdenney
Copy link
Contributor Author

Thanks!

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