Hello everyone.
I want to extract a specific column from some .csv files that have same rows and columns.
I wrote the code below and it works but without the column names. (see the screen shot)
The question is how I can save the selected each column with files names.
library(tidyr)
library(readr)
mylist <- list.files(path = "Y:/project2020/Data/texture/Extracting_data", pattern = "*.csv", full.names = T)
mass<- lapply(mylist, function(i){
x= read.csv(i)
x= x[c(42:140), c(2)]
})
print (mass)
write.csv(mass, file = "Y:/project2020/Data/texture/output.csv", row.names = F)