Right now i am pulling out data from different CSV named test1_october
, test2_october
... from file October
on my desktop. What my list does (I think) is compiles the name of all the tests (test1_october
, test2_october
, test3_october
) and runs them on the function, and then binds all the data together.
compilation_file <- c("test1_october", "test2_october","test3_october")
list_compilation <- vector("list", length(compilation_file))
names(list_compilation) <- compilation_file
tests<- lapply(compilation_file, function(test_name) {
Reponses<-read.csv(paste("/Users/Desktop/October/response/",test_name,".csv", sep = ""))
.
.
.
test_combined<-cbind()
return(test_combined)
})
test_combined<-do.call(rbind,tests)
However, i want to try further this script to pull data from more than 1 file, so making the filename a variable in the function. For example, January, February... October, November, December
How do i add this second variable on the function and run this variable on another list, it will scan different folders and pull out the respective UNIQUE CSV.
compilation_file <- c("test1_october", "test2_october","test3_october","test4_november","test5_december")
compilation_folder <- c("january", "february", "october","november","december")
Thank you.