list.files() can help find files in a directory, but how can I loop through a list of files already in text file? Where all\_my\_files.txt lists the path to each file one per row:

file.txt  

file2.txt  

file3.txt 

```
library(data.table)

files<- read.csv(all_my_files.txt)
for (i in 1:length(files))
{
df<-fread(files[i])
x<-mean(df$V1)
}

```