I have 7 files in my directory, I am trying to import all of them dynamically. I am using the following code:
file <- dir(getwd(),full.names=TRUE)
for (i in 1:length(file)){
file_i <- read.csv(file[i],stringsAsFactors = F)
}
Above code is not working as we have to define the new variable outside the for
loop. Can anybody suggest me a way?