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

Export generics #2528

Closed
hadley opened this issue Apr 19, 2018 · 3 comments
Closed

Export generics #2528

hadley opened this issue Apr 19, 2018 · 3 comments
Labels
Milestone

Comments

@hadley
Copy link
Member

@hadley hadley commented Apr 19, 2018

From Kurt Hornik:


You may have seen that from R 3.5.0 onwards searching for S3 methods
uses the registry after hitting topenv and before the search path, and
there is also a way of not using the search path at all, which can be
achieved by setting R_S3_METHOD_LOOKUP_BASEENV_AFTER_GLOBALENV_=true in
the environment. The Debian regular checks are currently performed with
this setting.

This shows S3 method lookup problems in about 250 CRAN packages, mostly
simply due to packages failing to register S3 methods when they could
and should. However, there are also cases when this is not possible:
R-exts says in "Registering S3 methods",

To ensure that these methods are available the packages defining the
methods should ensure that the generics are imported and register the
methods using 'S3method' directives.

which of course needs that the generics are exported.

Now, apparently several packages see the need to provide S3 methods for
the generics

guide_train
scale_type

which ggplot2 provides but does not export: my current list is

colorplaner/NAMESPACE:export(guide_train.colorplane)
ggraph/NAMESPACE:export(guide_train.edge_colourbar)
ggraph/NAMESPACE:export(guide_train.edge_direction)
phylopath/NAMESPACE:export(guide_train.edge_colourbar)

ggforce/NAMESPACE:export(scale_type.units)
ggmosaic/NAMESPACE:export(scale_type.product)
ggmosaic/NAMESPACE:export(scale_type.productlist)
ggraph/NAMESPACE:export(scale_type.geometry)

Would it be possible for ggplot2 to export these generics, so that the
above exports could be turned into proper S3 method registrations?

@tidyverse tidyverse deleted a comment from smouksassi Apr 19, 2018
@hadley
Copy link
Member Author

@hadley hadley commented Apr 24, 2018

Hadley to notify maintainers.

@hadley hadley added the feature label Apr 27, 2018
@hadley hadley added this to the v2.3.0 milestone Apr 27, 2018
@hadley hadley closed this in 3f0e860 May 1, 2018
@hadley
Copy link
Member Author

@hadley hadley commented May 1, 2018

@wmurphyrd @thomasp85 @Ax3man @haleyjeppson: please note than in the next release of ggplot2 you'll be able to properly provide S3method declarations in your NAMESPACE.

@lock
Copy link

@lock lock bot commented Oct 28, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Oct 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant