R获取地图自定义地图

R获取地图自定义地图,r,google-maps,ggmap,rmaps,R,Google Maps,Ggmap,Rmaps,我的数据框如下所示: Sho lat lon autoroute 1000001 46.20114 5.19791 0 1000002 46.21842 5.22767 1 1000004 46.18836 5.24447 0 1000006 46.20754 5.23758 1 1000007 46.20105 5.24891 0 我正在运行下一个代码来绘制坐标: library

我的数据框如下所示:

Sho        lat     lon       autoroute
1000001 46.20114 5.19791         0
1000002 46.21842 5.22767         1
1000004 46.18836 5.24447         0
1000006 46.20754 5.23758         1
1000007 46.20105 5.24891         0
我正在运行下一个代码来绘制坐标:

library(ggmap)
basec$autoroute <- as.factor(basec$autoroute)
cntr <- c(1.99, 46.95)
map <- get_googlemap(location = 'France',center=cntr, zoom = 6, maptype ="roadmap" )
mapPoints <- ggmap(map) +
             geom_point(aes(x = lon, y = lat, color = autoroute), data = basec,
                        size = 1, alpha = 0.5) + 
             scale_colour_manual(values = c("#00ffff","red")) +
             theme(legend.position = "none") +
             labs(x = "Longitude", y = "Latitude")
mapPoints
库(ggmap)

basec$自动路由您可以尝试添加到代码中。。。source=“osm”,maptype=“roadmap”…您有一个光栅地图。如果要修剪图像,可能会有所帮助。我宁愿使用法国的GADM数据,绘制一张地图,然后添加geom_point()