I need to read several compressed files with various compression formats. I do not want to manually extract all the files. I would like R to handle compression and reading regardless of the compression format. This is where I am stuck.
I could build a function with a sorting structure for zip-unzip, gz-gzfile, etc., but I would like to know if there is any function that can decompress files regardless of the compression format.
Any suggestions are welcome. Many thanks!
PS: I know that read.table can read (some, if not all) compressed files. However, I was advancing to data.table::fread (because it is much faster), and it seems like it cannot read compressed files ( http://r.789695.n4.nabble.com/fread-on- gzipped-files-td4663116.html - for now?). I would prefer temporarily unchecking and using fread rather than using read.table.
r
TheComeOnMan
source share