簡體   English   中英

在ubuntu中安裝R的igraph包

[英]Installation of igraph package of R in ubuntu

我使用以下命令在ubuntu中安裝R的igraph包: install.packages("igraph")

但我收到一個錯誤說:

警告:無法訪問存儲庫的索引
http://ftp.iitm.ac.in/cran/src/contrib :無法打開網址' http://ftp.iitm.ac.in/cran/src/contrib/PACKAGES '警告信息:包'igraph'是不可用(適用於R版本3.3.2)

有人可以指導這個問題,我在這里錯了...

可能還想要一個二進制包,我最近重新解釋了如何做到這一點:

最簡單的方法是這樣的(我在Ubuntu 16.04的Docker實例中只顯示命令而不顯示輸出,我在Docker中執行此操作,其中帳戶是root ;否則在前面添加sudo

apt-get update     # refresh
apt-get install software-properties-common
add-apt-repository -y "ppa:marutter/rrutter"
add-apt-repository -y "ppa:marutter/c2d4u"
apt-get update     # now with new repos
apt-get install r-cran-igraph

它只適用於所有依賴項。 你沒告訴我們你有什么Ubuntu版本。 我展示的內容如Ubuntu 16.04中所示; 對於更舊的版本,您需要為add-apt-repository命令使用不同的包。

我懷疑服務器已關閉或您的網絡已關閉或您需要通過代理服務器。

我可以通過設置一個無法獲得的CRAN鏡像來復制此消息:

> options(repos="http://example.com/")
> install.packages("foo")
Installing package into ‘/nobackup/rowlings/RLibrary/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository http://example.com/src/contrib:
  cannot open URL 'http://example.com/src/contrib/PACKAGES'

Warning message:
package ‘foo’ is not available (for R version 3.2.3) 

因此,要么再次嘗試,也許服務器已啟動,或檢查您的本地網絡是否正常,或嘗試其他CRAN鏡像,或與您的本地網絡管理員核實是否需要設置代理服務器。

你必須首先安裝build-essential

sudo apt-get install build-essential

在Ubuntu和Debian Linux上也需要安裝lixml2和libxml2-dev軟件包。

如果這不起作用,請檢查包的網頁以獲取額外的文檔

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM