1.
options(BioC_mirror="https://mirrors.tuna.tsinghua.edu.cn/bioconductor")
BiocManager::install("DESeq2", ask = F,update = F)
该设置方式中镜像的作用域似乎只在当前session
# 解决依赖
install.packages(c("curl", "openssl"), ask = F, update = F)
install.packages("openssl", ask = F, update = F)
2.
虽然 install.packages()并不支持版本的选择,但是如果你知道R包的源文件的位置:
https://cran.r-project.org/src/contrib/Archive或者其他镜像,则可以直接通过 source 的方式安装
packageurl = 'https://cran.r-project.org/src/contrib/Archive/ggplot2/ggplot2_3.3.5.tar.gz'
install.packages(packageurl, repos = NULL, type = 'source')
3.
options("repos"=c(CRAN = "https://mirrors.tuna.tsinghua.edu.cn/CRAN/"))
4.
.packages(all.available=T) # 在console显示已安装包的名字
(.packages()) # 显示 已加载包
标签:install,备份,update,https,scripts,ask,packages,安装,cn
From: https://www.cnblogs.com/yknNewbie/p/17706289.html