Skip to content

geom_sf seems to break when used with ggmap #2130

@yeedle

Description

@yeedle

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions