How to effectively deal with uncompressed saves during package check?

寵の児 提交于 2019-12-03 04:46:31

问题


In recent efforts to develop a package, I'm including datasets in the data/ folder of my package. In my specific case I have 5 datasets all of which are in data.table format (although the issues I describe below persist if I keep them as data.frame). I've saved each one as individual .rda files and documented them appropriately.

When I run check() from package devtools, I get the following warnings:

 checking data for ASCII and uncompressed saves ... WARNING
  Warning: large data file(s) saved inefficiently:
          size ASCII compress
  data1.rda 129Kb  TRUE     gzip
  data2.rda 101Kb  TRUE     gzip
  data3.rda 1.6Mb  TRUE     gzip

  Note: significantly better compression could be obtained
        by using R CMD build --resave-data
              old_size new_size compress
  data1.rda         129Kb     34Kb       xz
  data2.rda         101Kb     20Kb       xz
  data4.rda          92Kb     35Kb       xz
  data3.rda         1.6Mb    116Kb       xz
  species.rda     12Kb      9Kb       xz

I've tried saving the data with resaveRdaFiles (package tools) with the recommended xz compression. Even after doing that, the warning persists.

OK, so I run R CMD build --resave-data and the warning continues to persist.

What am I missing here and how do I overcome this issue (now and in the future)?


回答1:


When you save your .rda file, please use the command: save(..., file='test.rda', compress='xz') This will help to solve the problem!



来源:https://stackoverflow.com/questions/10233593/how-to-effectively-deal-with-uncompressed-saves-during-package-check

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!