热线电话:13121318867

登录
2018-10-18 阅读量: 1338
R中安装baidumap包遇到错误

R中安装baidumap包时遇到ERROR: lazy loading failed for package 'baidumap'

今天安装Remap跟baidumap包,操碎了心。

一、通畅版(无需再看)

library(devtools)
install_github('badbye/baidumap')
install_github('lchiffon/REmap')

二、便秘版

经多次尝试:函数安装+手动下载安装       REmap安装成功(还可重新设置默认浏览器尝试),结果baidumap均失败

installing *source* package 'baidumap' ...
** R
** tests
** preparing package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
  there is no package called 'munsell'
ERROR: lazy loading failed for package 'baidumap'
* removing 'D:/R/R-3.4.1-win/R-3.4.1/library/baidumap'
Installation failed: Command failed (1)

苦逼的我左看右看上看下看,左找右找均无果

后来灵机一动

我发现一个问题

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
  there is no package called 'munsell'

然后我就手动下载munsell包

https://cran.rstudio.com/bin/windows/contrib/3.4/munsell_0.4.3.zip

手动安装

install.packages("C:/Users/Administrator/Desktop/munsell_0.4.3.zip", repos = NULL, type = "win.binary")
package ‘munsell’ successfully unpacked and MD5 sums checked
> library(munsell)

然后重新尝试安装baidumap包

install_github('badbye/baidumap')

结果就成功了!成功了!成功了!

* installing *source* package 'baidumap' ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (baidumap)
> library(baidumap)

等等等!

这是什么?

library(baidumap)
baidumap 0.2.2
Apply an application from here: http://lbsyun.baidu.com/apiconsole/key
Then register you key by running `options(baidumap.key = 'xxx')`

啊啊啊啊.............好吧好吧好吧

然后,自己申请一个API就可以了。

0.0000
3
关注作者
收藏
评论(0)

发表评论

暂无数据
推荐帖子