2014-06-12 48 views
0

我正在嘗試一些數據挖掘並試圖從Twitter中檢索數據。R-twitteR軟件包下載包'rjson'失敗

當我試圖安裝包「推特」,我得到以下警告:

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 

我不熟悉故障排除這些錯誤。很感謝任何形式的幫助。

+0

您是否有可能使用舊版本的Rstudio/R?在6/10發佈了rjson的2.14版本。它看起來應該試圖安裝一個,而不是http://cran.rstudio.com/web/packages/rjson/index.html – MrFlick

+0

version.string R版本3.0.2(2013-09-25) –

回答

5

如果你不想升級你的R(我們現在在3.1版本),你可以從檔案中安裝。

  1. 下載版本2.13從http://cran.rstudio.com/src/contrib/Archive/rjson/rjson_0.2.13.tar.gz
  2. 在R,運行install.packages("<local path to the downloaded gz file>", repos=NULL, type="source")

希望這將工作。

+0

是啊,一旦我想出這一部分,我就刪除了我的評論。非常感謝您的幫助! –