我正在尝试一些数据挖掘并尝试从Twitter检索数据.
当我尝试安装包'twitteR'时,我收到以下警告:
Warning in install.packages : download of package ‘rjson’ failed
但它加载了其余的包.然后,当我尝试调用库时:
> library(twitteR) Loading required package: ROAuth Loading required package: RCurl Loading required package: bitops Attaching package: ‘RCurl’ The following object is masked from ‘package:tm.plugin.webmining’: getURL Loading required package: digest Error: package ‘rjson’ required by ‘twitteR’ could not be found
如果它最初无法下载'rjson'软件包,这是有道理的.
当我尝试单独安装'rjson'软件包时,我得到一个熟悉的错误:
> install.packages("rjson") trying URL 'http://cran.rstudio.com/bin/macosx/contrib/3.0/rjson_0.2.13.tgz' Warning in install.packages : cannot open: HTTP status was '404 Not Found' Error in download.file(url, destfile, method, mode = "wb", ...) : cannot open URL 'http://cran.rstudio.com/bin/macosx/contrib/3.0/rjson_0.2.13.tgz' Warning in install.packages : download of package ‘rjson’ failed
我不熟悉这些错误的疑难解答.很感谢任何形式的帮助.
如果您不想升级R(我们现在的版本为3.1),您可以从存档进行安装.
从http://cran.rstudio.com/src/contrib/Archive/rjson/rjson_0.2.13.tar.gz下载2.13版
在R中,运行 install.packages("<local path to the downloaded gz file>", repos=NULL, type="source")
希望这会奏效.