R语言批量提取指定列数据

1、

test <- read.table("a.txt", as.is = T)
test
index <- read.table("cols",as.is = T)
index
index <- as.vector(t(index))
index
test2 <- test[,index]
test2

 

posted @ 2021-07-21 23:48  小鲨鱼2018  阅读(6811)  评论(0编辑  收藏  举报