I'm not using a loop but using lapply and a function has the same behavior of a loop :
my_path <- "C:/Users/SAID ABIDI/Desktop/test/"my_a <- list.files(path = my_path)my_function <- function(x) { read_file(paste(my_path, my_a[x], sep = ""))}my_var <- lapply(1:length(my_a), my_function)
Does this help you ?