coderLMN
coderLMN
我运行这些代码成功了,除了第一行 `.libPaths("D:/R/library")` 没有用到。得到的结果如下: > all_links[1] > [1] "/government/speeches/secretary-of-state-for-culture-media-and-sport-written-statement-on-exercise-of-functions-under-the-public-libraries-and-museums-act-1964" > length(all_links) > [1] 2097
我没有遇到这个问题,所以没办法 debug。但是查了一下错误信息,找到了这个 stackoverflow 的帖:http://stackoverflow.com/questions/22537180/error-while-publishing-in-r-pubs ,里面说: > Add an .Rprofile file in the directory you are sending from and place this line: > > ``` r > options(rpubs.upload.method = "internal") >...
刚看到,怎么解决的?
rvest 包没用过,我感觉你前面的错误还是因为 .Rprofile 或 RProfile.site 的路径不对,要不就是 RProfile.site 里的 site 应该替换为网站的域名。 不管原因是什么,我建议你还是用 RCurl ,因为这个包在本书中会大量用到。 如果路径不清楚的话,根据 stackoverflow 上那个帖子里的评论,也可以直接在命令行执行 ``` R options(rpubs.upload.method = "internal") ``` 这条语句。我试了一下,是可以直接执行的。
包无法安装的问题似乎是国内镜像网站出问题了,我看到的错误信息是: > unable to access index for repository http://mirror.bjtu.edu.cn/cran/bin/macosx/mavericks/contrib/3.1 在 R Package Installer 界面里可以在左上角的下拉菜单里选 Other Repository ,右边会自动出来 http://R.research.att.com/ ,然后就可以安装了。
RCurl 的那个证书问题,可能是因为你的开发环境路径下没有那个证书文件。建议搜索一下这个文件,如果没有的话可以去 https://curl.haxx.se/ca/cacert.pem 下载 cacert.pem 。 对于这个问题,我还是建议你在 RCurl 包下尝试解决。可以参考书中 9.1.7 节(P201)的证书相关内容。
在原书的勘误 http://www.r-datacollection.com/errata/errata.pdf 里说明了,prescindMeta() 和 sFilter() 函数都不适用于 v0.6 以上的 tm 包,可以换成 meta() 来处理: > The prescindMeta() function is defunct as of version 0.6 of the tm package. The meta data can...
应该是Mac连续产生鼠标滚动事件的原因,我试过在事件处理逻辑里加个500ms的延迟,延迟时间内不处理滚动事件,不过这样又会有点卡的感觉,所以最后还是没用这个方法。
`FPAsins
大家可以参考一下。