I follow here some post here How to combine multiple .csv files in R? and here Reading Many CSV Files at the Same Time in R and Combining All into one dataframe
My purpose is basically the same: combining into one big matrix multiples, very large, csv file in R. I have this solution that I would like to speed up as much as possible:
Here a fully reproducible example; I have much more and bigger files
setwd("C:/") #### set an easy directory to create acceptably large files
#### this takes about 60 seconds
for(i in 1:80){
print(80-i)
write.table(matrix(rnorm(20*3891,0,1),ncol=20),col.names=F,row.names=F,sep=",",file=paste(i,"file.csv",sep=""))
}
listfiles<-list.files(path="C:/",pattern="*.csv")
#### now the problem: this takes about 30-40 seconds; as I have bigger (and much more) files I want to speed up this step
library(plyr)
mybigmatrix<-ldply(listfiles,read.csv,header=F)
Thanks in advance for any help