0

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?

pranav
  • 911
  • 1
  • 7
  • 11

0 Answers0