# 在安装过程中指定源地址
install.packages("RCurl", repos = "https://mirrors.tuna.tsinghua.edu.cn/CRAN/")
# 查看当前镜像
options()$repos
# 设置为中科大镜像
options("repos" = c(CRAN="https://mirrors.ustc.edu.cn/CRAN/")) # 更改Bioconductor的下载镜像
# 更改Bioconductor镜像
options()$BioC_mirror
# 设置清华镜像
options(BioC_mirror = "https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
options(repos = c(CRAN = "https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
# 中科大镜像
options(BioC_mirror="https://mirrors.ustc.edu.cn/bioc/")# 安装包
options(BioC_mirror="http://mirrors.ustc.edu.cn/bioc/") #设置镜像站if (!requireNamespace("BiocManager", quietly = TRUE))install.packages("BiocManager") #安装管理工具包BiocManager
BiocManager::install() #查看是否安装成功
# 之后便可以使用命令自动安装其他需要的包了,这种方法的好处就是,当碰到需要下载安装其他支持包时,会自动下载安装,比较省事。
BiocManager::install("org.Hs.eg.db") #生物注释数据库
BiocManager::install("clusterProfiler") #KEGG分析支持包# 使用devtools安装特定版本的包
install.packages("devtools")
devtools::install_github("Bioconductor/BiocManager", ref ="ghost-binary-repo")# 安装本地包
install.packages("路径/包名.tar.gz", repos = NULL, type = "source")
先切换成 个人 用户,然后export PATH=/home/user/softwares/R-3.5.1/bin:$PATH 来使用R-3.5.1环境自带的gcc/g++编译环境,进入R命令行后,执行.libPaths(“/home/user/softwares/R-3.5.1/lib/R/library”) 把library path设置为/home/user下的,最后再install.packages(“data.table”)
参考:
https://zhuanlan.zhihu.com/p/585036231