Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个要写入压缩 CSV 文件的大 data.frame。有没有办法直接将数据写入 CSV.TAR.GZ 压缩文件,而不是执行 write.csv/gzip 步骤以减少 DISK 访问?
谢谢。
使用gzfile(或bzfile用于 bzip2 归档,或xzfile用于 xz 归档)。
gzfile
bzfile
xzfile
write.csv(mtcars, file=gzfile("mtcars.csv.gz"))
PS。如果您只有一个数据框,那么您肯定不需要 tar。