Thank you. It worked with:
# import your original csv file
my_file <- read.csv("filename.csv")
# create an auxiliar list
colnumbers <- 1:100
colsplits <- split(colnumbers, ceiling(colnumbers/4))
# walk through it
purrr::iwalk(
colsplits,
~ write.csv(my_file[, .x], paste0(.y, ".csv"))
)
After that, I created a list with list.files(pattern="*.csv") and
file_list<-lapply(list_of_files, read_csv, col_names = TRUE)
Do you know can I apply the same function to all the files in the list? I tried with function(df) but it doesn't work. I need to rename all the columns and concatenate two of them inside of all files