包'rjson'的R - twitteR软件包下载失败了

时间:2014-06-12 21:47:33

标签: r twitter data-mining sentiment-analysis

我正在尝试一些数据挖掘并尝试从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

我不熟悉这些错误的疑难解答。很感谢任何形式的帮助。

1 个答案:

答案 0 :(得分:5)

如果您不想升级R(我们现在的版本为3.1),您可以从档案中安装。

  1. http://cran.rstudio.com/src/contrib/Archive/rjson/rjson_0.2.13.tar.gz
  2. 下载2.13版
  3. 在R中,运行install.packages("<local path to the downloaded gz file>", repos=NULL, type="source")
  4. 希望这会奏效。