I would like to know what is the recommended way of reading a data.table
from an archived file (zip archive in my case). One obvious option is to unzip it to a temporary file and then fread()
it as usual. I don't want to bother about creating new file, so instead I use read.table()
from unz()
connection and then convert it with data.table()
:
mydt <- data.table(read.table(unz(myzipfilename, myfilename)))
This works fine but read.table()
is slow for big files while fread()
can't read unz()
connection directly. I'm wondering if there is any better solution.