R version 3.5及以上安装Bioconductor包的方法改变了
解决方法:
1.安装Bioconductor
options(repos=structure(c(CRAN="https://mirrors.tuna.tsinghua.edu.cn/CRAN/")))
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
- 如果安装比较慢,可以配置R的安装源(永久)
sudo vi /etc/R/Rprofile.site
local({r <- getOption("repos")
r["CRAN"] <- "http://mirrors.tuna.tsinghua.edu.cn/CRAN/"
options(repos=r)})
- 在使用终端命令行安装包的时候,可以直接指定源(临时)
install.packages(‘gdata’, repos = ‘https://mirrors.tuna.tsinghua.edu.cn/CRAN’)
下面还有其他的镜像(https://cran.r-project.org/mirrors.html)
https://mirrors.tuna.tsinghua.edu.cn/CRAN/ TUNA Team, Tsinghua University
http://mirrors.tuna.tsinghua.edu.cn/CRAN/ TUNA Team, Tsinghua University
https://mirrors.ustc.edu.cn/CRAN/ University of Science and Technology of China
http://mirrors.ustc.edu.cn/CRAN/ University of Science and Technology of China
https://mirror.lzu.edu.cn/CRAN/ Lanzhou University Open Source Society
http://mirror.lzu.edu.cn/CRAN/ Lanzhou University Open Source Society
http://mirrors.xmu.edu.cn/CRAN/ Xiamen University
2.检查是否安装Bioconductor成功
BiocManager::available()
3.BiocManager下载软件
options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
library(BiocManager)
BiocManager::install('ballgown')
4.测试安装包是否加载成功
library(ballgown)
注:资料来源于:
https://blog.csdn.net/lotusng/article/details/101796763
https://www.omicsclass.com/article/106