REmap这个包是通过调用百度地图API的一个程序包,与Google的ggmap包相比,不用翻墙就可以使用。其函数主要有:remap(),remapB()、remapC()、remapH()四个。该程序包目前要github网站上,因此我们需要从github上面下载安装。
install.packages("devtools")#如果安装了就不需要这步
library(devtools)
install_github('lchiffon/REmap')
一. remap()
这个函数可以创建一个remap()函数对象,然后再由plot()函数输出并在浏览器中打开。
函数原型:
remap(mapdata, title = "", subtitle = "", theme = get_theme("Dark"))
参数 |
含义 |
mapdata |
数据集,每行数据表示从出发点到终点 |
title |
标题 |
subtitle |
副标题 |
theme |
主题,背景颜色 |
set.seed(125)
out = remap(demoC,title = "REmap",subtitle = "theme:Dark")
plot(out)
结果如下: