I am trying to merge 2000 files of 2MB each into a single file. Each files has 2 columns of 100000 rows. Its a simple code though, but I am getting a error that reads:
Error: cannot allocate vector of size 37.3 Gb
How do I solve this?
I am running a 64-bit R on 8GB RAM Windows 10. I have tried increasing the memory size to 50GB, but no use. Any suggestions please?
Here is my code: location is the variable that contains the path.
multmerge = function(mypath){
filenames=list.files(path=mypath, full.names=TRUE)
datalist = lapply(filenames, function(x){read.csv(file=x,header=T)})
Reduce(function(x,y) {merge(x,y)}, datalist)}
new_data<-multmerge(location)