Skip to content

Fix fortify-spatial namespace issue (#879) #911

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 2 commits into from
Mar 13, 2014
Merged

Fix fortify-spatial namespace issue (#879) #911

merged 2 commits into from
Mar 13, 2014

Conversation

seancarmody
Copy link
Contributor

Fixes fortify error when sp namespace is not loaded.
#879

Fixes fortify error when sp namespace is not loaded.
#879
@hadley
Copy link
Member

hadley commented Feb 25, 2014

In what scenario would sp() not be loaded?

@seancarmody
Copy link
Contributor Author

Here's the example from the original issue:

bx <- rgeos::readWKT("POLYGON ((112.5 -44, 112.5 -9, 154 -9, 154 -44, + 112.5 -44))")
bx <- as(bx, "SpatialPolygonsDataFrame")
fortify(bx, region="dummy")
# Error in fortify.SpatialPolygonsDataFrame(bx, region = "dummy") : 
#  could not find function "polygons"

A more serious example is in the rmapaus package I have been working on, where I want to load map data and the use ggplot2 to plot it. I would prefer to stick to Imports rather than Depends, which I understand to be better practice.

@hadley
Copy link
Member

hadley commented Feb 26, 2014

Got it. Could you please add a short explanatory note to NEWS?

@seancarmody
Copy link
Contributor Author

Done.

hadley added a commit that referenced this pull request Mar 13, 2014
Fix fortify-spatial namespace issue (#879)
@hadley hadley merged commit cfc0728 into tidyverse:master Mar 13, 2014
@lock
Copy link

lock bot commented Jan 19, 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 Jan 19, 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.

2 participants