0

everybody!

I have a 50MB .RData file which is one large data frame. Can I compress it to 20-25MB somehow? I tried .zip and .gz, but the former almost did nothing and the latter even generated a bigger file.

Also, what's the most space-efficient way to export the workspace in RStudio? Again, using .RData generates a massive file, and I wonder if I can make it smaller.

Anybody with more experience? Thank you very much!

Paw in Data
  • 1,262
  • 2
  • 14
  • 32
  • I have very limited knowledge of RStudio, did a quick read of some material. If the RStudio program already compresses the file saved you will find it difficult to compress further. What are the first 5-10 bytes of the .RData file. If the data can be Pre / Post processed (looks like the API allows you to apply before and after processing) to save / Retrieve via an external program, it "MIGHT" be able to be compressed . (assuming Lossless compression). changing how the original RData is saved, the post processed for compression , then pre-process for retrieval might help. – Phillip Williams Jan 23 '20 at 15:51
  • Also note: The type of data to be compressed will determine if it can be compressed at all. IE: random data, compression most likely not possible , or limited.. Try saving it in "A" ASCII format , then try the compression. maybe binary "X" mode mangles it to much. interesting article: https://www.r-bloggers.com/efficiently-saving-and-sharing-data-in-r/ – Phillip Williams Jan 23 '20 at 16:07
  • Thanks! @PhillipWilliams I figured it's a long shot. – Paw in Data Jan 24 '20 at 00:51
  • This may help: https://stackoverflow.com/questions/13396603/compressing-data-frames-in-r – pakalla Nov 17 '22 at 06:08

0 Answers0