Fastest way to read in 100,000 .dat.gz files

后端 未结 3 1435
耶瑟儿~
耶瑟儿~ 2020-12-05 11:45

I have a few hundred thousand very small .dat.gz files that I want to read into R in the most efficient way possible. I read in the file and then immediately ag

3条回答
  •  误落风尘
    2020-12-05 12:20

    R has the ability to read gzipped files natively, using the gzfile function. See if this works.

    rbindlist(lapply(dat.files, function(f) {
        read.delim(gzfile(f))
    }))
    

提交回复
热议问题