-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Dynamically assign pathGrob in .onLoad() #3331
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
Dynamically assign pathGrob in .onLoad() #3331
Conversation
…class GeomPolygon from throwing an install warning. Fixes tidyverse#3312.
If I understand correctly what is happening, the install warnings should only occur if you're installing with R version 3.5 or earlier. Do you have an R 3.5 environment with which you could test this? |
I think I can figure something out with RStudio cloud...stay tuned. |
With ggspatial in RStudio Cloud running R 3.5, this PR does appear to fix the warning. I used: remotes::install_github("tidyverse/[email protected]") # no warning
remotes::install_github("tidyverse/ggplot2") # warning
remotes::install_github("paleolimbot/ggplot2@13ff581") # no warning! |
# do not install with error `possible error in 'pathGrob(munched$x, munched$y, ': | ||
# unused argument (pathId = munched$group)` despite the fact that this is correct | ||
# usage | ||
pathGrob <- NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own understanding: Why do we need this assignment outside of .onLoad()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied what was in sf:::.onLoad() that @thomasp85 suggested we use as a reference. My guess is that it prevents the superassign from accidentally assigning in the global environment (or prevents a warning to that effect)
Thanks! |
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/ |
This is a PR to fix #3313, where packages that subclass
GeomPolygon
were giving install warnings with the new version of ggplot2 in the revdep checks (#3303).I was hesitant to prepare this PR, because I don't understand why this works, and because I can't replicate the install warning that occurred in the revdep checks, I can't verify that this PR fixes the problem. I can verify that it doesn't cause any CMD check failures for either ggplot2 or ggspatial, which was one of the packages affected by the revdep check issue.