教小高改bug

  博客园 :: 首页 :: 博问 :: 闪存 :: :: 联系 :: :: 管理 ::
  49 随笔 :: 28 文章 :: 20 评论 :: 77803 阅读

1. 设置镜像

1
2
options(BioC_mirror="http://mirrors.tuna.tsinghua.edu.cn/bioconductor/")
options("repos" = c(CRAN="http://mirrors.tuna.tsinghua.edu.cn/CRAN/"))

2. R包分类

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cran_packages <- c("tidyr",
                   "tibble",
                   "dplyr",
                   "stringr",
                   "ggplot2",
                   "ggpubr",
                   "factoextra",
                   "FactoMineR",
                   "pheatmap",
                   "survival",
                   "survminer",
                   "patchwork",
                   "ggstatsplot",
                   "ggplotify",
                   "cowplot",
                   "glmnet",
                   "ROCR",
                   "caret",
                   "randomForest",
                   "survminer",
                   "Hmisc",
                   "e1071",
                   "deconstructSigs",
                   "timeROC"
)
Biocductor_packages <- c("KEGG.db",
                         "limma",
                         "clusterProfiler",
                         "org.Hs.eg.db",
                         "TCGAbiolinks",
                         "SummarizedExperiment",
                         "RTCGA",
                         "RTCGA.rnaseq",
                         "RTCGA.clinical",
                         "DESeq2",
                         "edgeR",
                         "ggpubr",
                         "rtracklayer",
                         "genefilter",
                         "maftools",
                         "ComplexHeatmap",
                         "BSgenome",
                         "GDCRNATools",
                         "BSgenome.Hsapiens.UCSC.hg38"
)

3. R包安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
for (pkg in cran_packages){
  if (! require(pkg,character.only=T) ) {
    install.packages(pkg,ask = F,update = F)
    require(pkg,character.only=T)
  }
}
 
if(!require("BiocManager")) install.packages("BiocManager",update = F,ask = F)
options(BioC_mirror="http://mirrors.tuna.tsinghua.edu.cn/bioconductor/")
getOption("BioC_mirror")
getOption("repos")
 
for (pkg in Biocductor_packages){
  if (! require(pkg,character.only=T) ) {
    BiocManager::install(pkg,ask = F,update = F)
    require(pkg,character.only=T)
  }
}

 4. 判断是否安装成功

前面的报错都先不要管。主要看这里

1
2
3
for (pkg in c(Biocductor_packages,cran_packages)){
  require(pkg,character.only=T)
}

没有error就是成功! 哪个报错,就回去安装哪个。

如果你没有安装xx包,却提示你xx包不存在,这也正常,是因为复杂的依赖关系,缺啥补啥。

5. 本地安装tinyarray包

1
if(!require(tinyarray))devtools::install_local("tinyarray-master.zip",upgrade = F)

 

posted on   小高不高  阅读(263)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 如何使用 Uni-app 实现视频聊天(源码,支持安卓、iOS)
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
点击右上角即可分享
微信分享提示