How I can extend belowed code to add an additional column with file name:
library(data.table)
files = list.files(pattern="*.csv")
DT = do.call(rbind, lapply(files, fread)
Or maybe is a better way to do it?
I need to load many files into one data.table with information about source file.