title: Compress Data in R
body: <p>I am looking to compress data in R for shiny App.My overall data is ~1.8 GB.
  And the maximum limit for a free Shiny Apps Account is ~1GB.
  I have 5 data sets and have tried the following methods (shown for only 1 dataset).The file if saved as a text file is 900MB.</p>
  
  <p>Compression into CSV (compresses to a 574 MB file)</p>
  
  <pre><code>gz1 &lt;- gzfile("geneExpressionMatrix_yf1.gz", "w")
  write.csv(geneExpressionMatrix_yf1, gz1)
  close(gz1)
  </code></pre>
  
  <p>Saving the data as RData.(compresses to a 340MB file)</p>
  
  <pre><code>save(tsneCoordinates_yf1, file="AgedMale_1_comp.RData", compress="xz")
  </code></pre>
  
  <p>Saving as a compressed text file (compresses to a 550MB file)</p>
  
  <pre><code>write.table(geneExpressionMatrix_yf1,gzfile("test.dat.gz"))
  </code></pre>
  
  <p>The maximum compression is obtained by saving as a RData,however this is still huge as I have 5 such datasets.
  Is there any way I can compress RData further? or any other method to compress this data smaller than RData ?</p>
  
  <p>Thanks,</p>
  
  <p>Ron</p>