I have hundreds of dataframes in a local folder, all of which have the same colnames. I want to rbind them simultaneously. I've tried the following code but I think it's too redundant and slow.
local_file <- list.files(wkdir, patterns = '.txt')
df <- data.frame()
for (i in 1:length(local_file)) {
tmp <- paste(wkdir, local_file[i], sep = '')
tmp <- fread(tmp) %>% data.frame()
df <- rbind(df, tmp)
}