Skip to content
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

does roxygen2 support internal S3 methods? #1654

Closed
tdhock opened this issue Sep 4, 2024 · 5 comments
Closed

does roxygen2 support internal S3 methods? #1654

tdhock opened this issue Sep 4, 2024 · 5 comments

Comments

@tdhock
Copy link

tdhock commented Sep 4, 2024

Hi! roxygen2 gives warnings like "S3 method getStrips.grid needs @export or @exportS3method" for animint2, animint/animint2#148
I see these warnings come from

"S3 method {.arg {name}} needs @export or @exportS3Method tag"

These S3 methods are internal (we don't want to export them). Is there any other way to supprress this warning?

@tdhock
Copy link
Author

tdhock commented Sep 4, 2024

John Fox also was wondering about this on R-devel, https://stat.ethz.ch/pipermail/r-package-devel/2024q3/011069.html

@olivroy
Copy link
Contributor

olivroy commented Sep 6, 2024

See #1592 (comment)

@tdhock
Copy link
Author

tdhock commented Sep 7, 2024

that comment says from R-3.5 onward, S3 methods should be registered even if they are not exported. How do you do that with roxygen2? the warning says needs @export or @exportS3Method but I do not want to export.

@olivroy
Copy link
Contributor

olivroy commented Sep 8, 2024

Well, that's the thing, the @export tag without documentation has the effect of registering them. https://roxygen2.r-lib.org/dev/articles/namespace.html?q=s3#s3

@tdhock
Copy link
Author

tdhock commented Sep 17, 2024

right, thanks, that documentation is adequate, I just did not find it until you linked it.
Thanks

'While S3 methods are regular functions with a special naming scheme, their “export” works a bit differently. S3 methods are exported only in the sense that calling the generic with the appropriate class will call the method; a user can’t directly access the method definition by typing its name. A more technically correctly term would be to say that the method is registered so that the generics can find it.'

@tdhock tdhock closed this as completed Sep 17, 2024
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