安装包的代码
Biocounductor 包
biopackage<-c("A","B")
for (pkg in biopackage){
if (! require(pkg,character.only=T) ) {
BiocManager::install(pkg,ask = F,update = F)
require(pkg,character.only=T)
}
}
Cran 包
cranpackage<-c("A","B") # cran 包
for (pkg in cranpackage){
if (! require(pkg,character.only=T) ) {
install.packages(pkg,ask = F,update = F)
require(pkg,character.only=T)
}
}
查看R包下面都有什么函数:
ls("package:limma") #以 limma 包为例
加载常用的包
library(GEOquery)
library(clusterProfiler)
library(org.Hs.eg.db)
library(enrichplot)
library(dplyr)
library(tidyverse)
library(reshape2)
library(cowplot)
library(stringr)
#详细用法见“R语言数据清洗”的 P138-150 以及 “R resourses Cheatsheets”的 P57-58
library(ggplot2)
library(limma)
library(edgeR)