Search code examples
rzipcompression

R directly save data as zip file


I found zip and the RCompression package but can they do:

write.zip(x, file = "foo.zip")

as you'd with write.csv?

I'm also aware of gzfile.


Solution

  • It's possible using gzip.

    write.csv(mtcars, file=gzfile("mtcars.csv.gz"))