문제

I have a big data.frame that I want to write into a compressed CSV file. Is there any way to directly write the data into a CSV.TAR.GZ compressed file instead of performing write.csv/gzip steps in order to reduce DISK access?

Thanks.

도움이 되었습니까?

해결책

Use gzfile (or bzfile for bzip2 archiving, or xzfile for xz archiving).

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

PS. If you only have one data frame, surely you don't need tar.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top