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
.
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
.
This can be accomplished pretty easily using the readr functions and gzip.
library(readr)
write_tsv(mtcars, file.path(dir, "mtcars.tsv.gz"))
write_csv(mtcars, file.path(dir, "mtcars.csv.gz"))
From the docs, ?write_csv
:
The
write_*()
functions will automatically compress outputs if an appropriate extension is given. Three extensions are currently supported:.gz
for gzip compression,.bz2
for bzip2 compression and.xz
for lzma compression. See the examples for more information.