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

Changes in plot() generics #96

Open
rsbivand opened this issue Dec 18, 2020 · 0 comments
Open

Changes in plot() generics #96

rsbivand opened this issue Dec 18, 2020 · 0 comments

Comments

@rsbivand
Copy link
Contributor

R 4.0.0 News says (https://cran.r-project.org/doc/manuals/r-release/NEWS.html):

The plot() S3 generic function is now in package base rather than package graphics, as it is reasonable to have methods that do not use the graphics package. The generic is currently re-exported from the graphics namespace to allow packages importing it from there to continue working, but this may change in future.

Packages which define S4 generics for plot() should be re-installed and package code using such generics from other packages needs to ensure that they are imported rather than rely on their being looked for on the search path (as in a namespace, the base namespace has precedence over the search path).

This led to me being contacted by a user who has a local package that stopped working in R 4, because inside his package which depended on maptools, which depends on sp (but his package didn't depend on sp), in R<4, plot() from sp was found in the search path, but in R4, base plot() was found. I advised adding sp:: to the plot call to disambiguate (this worked), or doing NAMESPACE properly (I didn't try).

A side note: should we consider importing plot from base in sp rather than graphics in R>=4?

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

1 participant