报错信息:
> install.packages("iCAMP")
Warning in install.packages :
unable to access index for repository https://cloud.r-project.org/src/contrib:
cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'
Installing package into ‘/home/lrst/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
unable to access index for repository https://cloud.r-project.org/src/contrib:
cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'
Warning in install.packages :
package ‘iCAMP’ is not available for this version of R
A version of this package for your version of R might be available elsewhere,
see the ideas at
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
报错分析:R的版本过低或者程序包默认安装最新超过适配R版本
解决方案:
(一)更新R版本
(二)查找有无旧版本的程序包
示例方案:
(1)搜索“r语言 安装已下载的包iCAMP”
(2)点击“Old sources:***”
(3)复制对应版本链接
对应路径下载:
wget https://cran.r-project.org/src/contrib/Archive/iCAMP/iCAMP_1.2.8.tar.gz
(4)安装
这一步可能遇到的报错:
> install.packages("/data/lrst/software/iCAMP_1.2.9.tar.gz", repos = NULL, type = "source")
Installing package into ‘/home/lrst/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
ERROR: dependencies ‘vegan’, ‘permute’, ‘bigmemory’, ‘nortest’, ‘minpack.lm’, ‘Hmisc’ are not available for package ‘iCAMP’
* removing ‘/home/lrst/R/x86_64-pc-linux-gnu-library/4.1/iCAMP’
Warning in install.packages :
installation of package ‘/data/lrst/software/iCAMP_1.2.9.tar.gz’ had non-zero exit status
解决方法:安装好‘vegan’, ‘permute’, ‘bigmemory’, ‘nortest’, ‘minpack.lm’, ‘Hmisc’后再安装iCAMP
(5)over! over!