Skip to content

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

Merged
merged 1 commit into from
May 15, 2019

Conversation

paleolimbot
Copy link
Member

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.

…class GeomPolygon from throwing an install warning. Fixes tidyverse#3312.
@clauswilke
Copy link
Member

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?

@paleolimbot
Copy link
Member Author

I think I can figure something out with RStudio cloud...stay tuned.

@paleolimbot
Copy link
Member Author

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
Copy link
Member

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()?

Copy link
Member Author

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)

@clauswilke clauswilke merged commit 8406115 into tidyverse:master May 15, 2019
@clauswilke
Copy link
Member

Thanks!

@paleolimbot paleolimbot deleted the issue-3312-pathGrob-usage branch May 15, 2019 18:24
@lock
Copy link

lock bot commented Nov 11, 2019

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 Nov 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

facet_wrap() and facet_grid() with a date variable is broken
2 participants