R - twitteR package download of package ‘rjson’ failed

拥有回忆 提交于 2019-12-12 01:49:35

问题


I am trying my hand at some data mining and attempting to retrieve data from Twitter.

When I tried installing the package 'twitteR', I get the following warning:

Warning in install.packages :
  download of package ‘rjson’ failed

But it loads the rest of the packages. Then when I try to call the library:

> 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

Which makes sense, if it could not download the 'rjson' package initially.

When I tried to install the 'rjson' package alone, I get a familiar error:

> 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

I am not familiar with troubleshooting these errors. Any help is very much appreciated.


回答1:


If you don't want to upgrade your R (we're at version 3.1 now), you can install from the archives.

  1. Download version 2.13 from http://cran.rstudio.com/src/contrib/Archive/rjson/rjson_0.2.13.tar.gz
  2. In R, run install.packages("<local path to the downloaded gz file>", repos=NULL, type="source")

Hopefully that will work.



来源:https://stackoverflow.com/questions/24194458/r-twitter-package-download-of-package-rjson-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!