##提取列表中包含特定字符的元素
DE.pattern = your_list[grep(pattern = "pattern",x = names(your_list),value = T)]
##批量读取列表内文件名字
library(pipeR)
library(rlist)
test = list.files(path = "E:/Desktop/",pattern = "*" )
write.table(test,"E:/Desktop/readme.xls",sep = "\t")
###读取Excel中所有sheet
library(readxl)
excel_path <- c("your path/附件1植物激素MRM定量分析结果-1读取.xlsx")
data = list()
for (i in 1:length(excel_sheets(excel_path))) {
data[[i]] = read_xlsx(path = excel_path,sheet = i)
}
names(data) = excel_sheets(excel_path)
###替换掉数据中的inf/NA/0
yourdata[yourdata==Inf]<-NA
###绘制热图时去掉所有值行为0的行
data_figure = data_figure[which(rowSums(data_figure)>0),]
网友评论