R get_map自定义地图

时间:2016-03-19 21:11:29

标签: 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(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

我有:

enter image description here

有一种方法只能展示法国吗?有没有办法消除绿色部分?我只需要展示法国的主要道路和地图上的点。

0 个答案:

没有答案