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

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

 

相关文章: