For fast reading of files, we can use fread
from data.table
and then rbind
the list
of data.table
using rbindlist
specifying the idcol=TRUE
to provide a grouping variable to identify each of the datasets
library(data.table)
DT <- rbindlist(lapply(lfiles, fread), idcol=TRUE)