When I geocode with ggmap:

library(ggmap)    
map_obj <- get_map("Anchorage, AK")

how do I find the lat and long ranges it has? I can do a str(map_obj) and see $ll.lat, $ll.lon ... but how can I get these? I've tried map_obj$ll.lon

I'm asking this question because I would like to subset my data points to only the visible area of the map instead of throwing the entire lat and long vectors at ggmap.

有帮助吗?

解决方案

To get all the bounding box data:

attr(map_obj, "bb")

To get a specific coordinate:

attr(map_obj, "bb")$ll.lat

(and so on)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top