R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> install.packages('devtools')
Installing package into ‘/home/kingslee/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Warning in install.packages :
dependency ‘xml2’ is not available
also installing the dependency ‘rversions’
--2015-07-29 12:02:27--
https://cran.rstudio.com/src/contrib/rversions_1.0.2.tar.gz
Resolving cran.rstudio.com (cran.rstudio.com)... 54.230.188.51
Connecting to cran.rstudio.com (cran.rstudio.com)|54.230.188.51|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4654 (4.5K) [application/x-gzip]
Saving to: ‘/tmp/Rtmpcd8fcf/downloaded_packages/rversions_1.0.2.tar.gz’
0K .... 100%
540M=0s
2015-07-29 12:02:29 (540 MB/s) -
‘/tmp/Rtmpcd8fcf/downloaded_packages/rversions_1.0.2.tar.gz’ saved [4654/4654]
--2015-07-29 12:02:29-- https://cran.rstudio.com/src/contrib/devtools_1.8.0.tar.gz
Resolving cran.rstudio.com (cran.rstudio.com)... 54.230.188.51
Connecting to cran.rstudio.com (cran.rstudio.com)|54.230.188.51|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 141487 (138K) [application/x-gzip]
Saving to: ‘/tmp/Rtmpcd8fcf/downloaded_packages/devtools_1.8.0.tar.gz’
0K .......... .......... .......... .......... .......... 36% 388K 0s
50K .......... .......... .......... .......... .......... 72% 487K 0s
100K .......... .......... .......... ........ 100% 440K=0.3s
2015-07-29 12:02:30 (434 KB/s) -
‘/tmp/Rtmpcd8fcf/downloaded_packages/devtools_1.8.0.tar.gz’ saved [141487/141487]
ERROR: dependency ‘xml2’ is not available for package ‘rversions’
* removing ‘/home/kingslee/R/x86_64-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/kingslee/R/x86_64-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/Rtmpcd8fcf/downloaded_packages’
最佳答案
您可以在计算机上安装该 xml 工具。
sudo apt-get -y install libxml2-dev
如果这确实消除了您的错误,您应该遵循 this post有关如何在 Ubuntu 上正确设置 R 的更多说明
关于linux - 在 Ubuntu 中安装 devtools 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31693389/