1.准备两个excel表格
gene200
gene121
2.得到结果:
gene86
getwd()#查看当前工作目录
gene200 <- read.csv("200genes.csv",row.names = 1,stringsAsFactors = F)
head(gene200)
row.names(gene200)
gene121 <- read.csv("121genes.csv",stringsAsFactors = F)
head(gene121)
class(gene200)
gene200[gene121$gene,]
#.1表示有重复,需要去重复
unique(gene121$gene)
gene200[unique(gene121$gene),]
#NA表示找不到的东西,使用函数去除NA
gene93 <- gene200[unique(gene121$gene),]
na.omit(gene93)#去除na
gene86 <- na.omit(gene93)
write.csv(gene86,file="gene86.csv")
网友评论