- 1.首先导入数据
data<-read.table("haplotype.1",header = T,sep='\t',row.names=1)
数据框里的内容如下
- 2.提取列名中含有特定字符的列
test1=data[c(grep("BC|FT",colnames(data)))]
同理,如果要去掉含有这些字符的列
other=data[-c(grep("BC|FT",colnames(data)))]
data<-read.table("haplotype.1",header = T,sep='\t',row.names=1)
数据框里的内容如下
test1=data[c(grep("BC|FT",colnames(data)))]
同理,如果要去掉含有这些字符的列
other=data[-c(grep("BC|FT",colnames(data)))]