【发布时间】:2015-08-27 23:04:54
【问题描述】:
我是 R 和 RStudio 的新手,但我正在努力学习和组合一个 ShinyApps 应用程序。我无法通过 Shinyapps 流程的第 1 步,即在 RStudio 中安装 devtools 包。我相信根本原因是没有安装“xml2”包依赖项,但我似乎无法解决这个问题,我不明白该怎么做。
我在戴尔笔记本电脑上使用 Linux Mint Cinnamon 17.1。我从软件管理器安装了 RStudio。在尝试解决 devtools 安装期间的错误时,我尝试使用 apt-get 从稍新的软件包下载安装 R 和 RStudio,我尝试从 RStudio 安装 xml2 和 rversions(不可用),我已经尝试使用单引号和双引号,我尝试将dependency=true 添加到所有 RStudio 安装尝试中,我已经多次重新启动 RStudio 和机器......我没有想法......帮助?
以下是 RStudio 中 devtools 安装命令的输出,加上“版本”的输出以防有帮助。
install.packages("devtools")
Installing package into ‘/home/[MyHomeDir]>/R/i686-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘xml2’ is not available
also installing the dependency ‘rversions’
trying URL 'http://cran.rstudio.com/src/contrib/rversions_1.0.1.tar.gz'
Content type 'application/x-gzip' length 4624 bytes
opened URL
==================================================
downloaded 4624 bytes
trying URL 'http://cran.rstudio.com/src/contrib/devtools_1.8.0.tar.gz'
Content type 'application/x-gzip' length 141487 bytes (138 Kb)
opened URL
==================================================
downloaded 138 Kb
ERROR: dependency ‘xml2’ is not available for package ‘rversions’
* removing ‘/home/[MyHomeDir]/R/i686-pc-linux-gnu-library/3.0/rversions’
Warning in install.packages :
installation of package ‘rversions’ had non-zero exit status
ERROR: dependency ‘rversions’ is not available for package ‘devtools’
* removing ‘/home/[MyHomeDir]/R/i686-pc-linux-gnu-library/3.0/devtools’
Warning in install.packages :
installation of package ‘devtools’ had non-zero exit status
The downloaded source packages are in
‘/tmp/RtmpNJIGkV/downloaded_packages’
version
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 3
minor 0.2
year 2013
month 09
day 25
svn rev 63987
language R
version.string R version 3.0.2 (2013-09-25)
nickname [nickname redacted]
【问题讨论】:
-
见这里:stackoverflow.com/questions/30794035/…(1 小时前被问到)。
-
这个答案听起来很有希望(从更新的存储库安装 R 3.2.0),但我们如何知道要使用哪个 Ubuntu 版本(生动、乌托邦、可靠、精确)?
-
帕斯卡,它成功了!谢谢你。根据您上面的第一条评论,我从 CRAN 存储库安装了 R 3.2.0(而不是 3.0.2),根据您的第二条评论,Linux Mint Cinammon 17.1 构建在 Ubuntu“可信赖”之上。在安装 R 3.2.0 之后,我仍然必须在安装 devtools 之前执行以下操作:命令提示符下的“sudo apt-get install libxml2-dev”,然后 install.packages("xml2", dependencies=true) 并安装.packages("rversions", dependencies=true) 来自 RStudio 的提示。感谢您的帮助!
标签: r dependencies rstudio devtools shiny