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

geom_sf seems to break when used with ggmap #2130

Closed
yeedle opened this issue May 11, 2017 · 1 comment
Closed

geom_sf seems to break when used with ggmap #2130

yeedle opened this issue May 11, 2017 · 1 comment

Comments

@yeedle
Copy link
Contributor

yeedle commented May 11, 2017

This might be an issue with ggmap or an issue with how geom_sf handles inherited aesthetic mappings. I'm not sure, so I'm submitting it here and to ggmap

library(sf)
library(ggmap)

nc_map <- get_map(c(-81, 35), zoom = 6) 
#> Map from URL : http://maps.googleapis.com/maps/api/staticmap?center=35,-81&zoom=6&size=640x640&scale=2&maptype=terrain&language=en-EN&sensor=false
ggmap(nc_map)

nc <- st_read(system.file("shape/nc.shp", package="sf"))
ggplot(nc) + geom_sf()

ggmap(nc_map) + geom_sf(data = nc)
#> Error in FUN(X[[i]], ...): object 'lon' not found
@yeedle yeedle changed the title geom_sf breaks when used with ggmap geom_sf seems to break when used with ggmap May 11, 2017
@hadley
Copy link
Member

hadley commented May 24, 2017

I think this is a design infelicity in ggmap. Really it should provide geom_ggmap() which works similar to geom_sf().

@hadley hadley closed this as completed May 24, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants