extrobe
9/6/2017 - 9:38 PM

Import data from multiple files

This loads all the files in a given directory into a single dataframe

library(data.table)  
files <- list.files(path = "/etc/dump",pattern = ".csv")
temp <- lapply(files, fread, sep=",")
data <- rbindlist( temp )
bp2 <- "C:/Users/usernm/git-repos/david-a/r/data/dailylatency/" 
fileList <- list.files(path=bp2, pattern=".csv")
basedata <- do.call(rbind,lapply(paste(bp2,fileList,sep=""), read.csv,sep="|", header=FALSE))