在ubuntu中安装R的igraph软件包 [英] Installation of igraph package of R in ubuntu
问题描述
我正在使用以下命令在ubuntu中安装R的igraph软件包:install.packages("igraph")
I am using the following command for the installation of igraph package of R in ubuntu : install.packages("igraph")
但是我收到一个错误消息:
But I am getting an error saying:
警告:无法访问存储库的索引
http://ftp.iitm.ac.in/cran/src/contrib:无法打开URL ' http://ftp.iitm.ac.in/cran/src/contrib /PACKAGES "警告消息: 软件包"igraph"不可用(对于R版本3.3.2)
Warning: unable to access index for repository
http://ftp.iitm.ac.in/cran/src/contrib: cannot open URL 'http://ftp.iitm.ac.in/cran/src/contrib/PACKAGES' Warning messages: package ‘igraph’ is not available (for R version 3.3.2)
有人可以指导这个问题吗,我在哪里出错了...
Can someone please guide regarding this problem, where I am going wrong in this...
推荐答案
无论如何,您可能都想要一个二进制包,而我最近重新解释了如何执行此操作:
You probably want a binary package anyway, and I recently re-explained how to do this:
最简单的方法是这样的(在Ubuntu 16.04的Docker实例中执行此操作时,我仅显示命令,而不显示输出,而我在帐户为root
的Docker中执行此操作;否则在前面添加sudo
)
The easiest way is something like this (and I am showing only the commands, not the output while I do this in a Docker instance of Ubuntu 16.04, and I am doing this in Docker where the account is root
; otherwise add sudo
in front)
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
命令使用其他软件包.
and it will just work with all its dependencies. You didn't tell us what Ubuntu version you have. What I showed works eg in Ubuntu 16.04; for much older releases you need a different package for the add-apt-repository
command.
这篇关于在ubuntu中安装R的igraph软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!