[Rd] Automatic Compression by Save Causes Check Warning

Dario Strbenac d@tr7320 @ending from uni@@ydney@edu@@u
Mon Jun 18 10:00:04 CEST 2018

Good day,

Save sometimes chooses a compression method which causes a warning during package checking. An example of this is:

measurements <- matrix(round(rnorm(2000*190), 2), nrow = 2000, ncol = 190)
classes <- factor(sample(LETTERS[1:2], 190, replace = TRUE))
save(measurements, classes, file = "data/experiment.RData")

then, when the package is checked,

* checking data for ASCII and uncompressed saves ... WARNING
  Note: significantly better compression could be obtained
        by using R CMD build --resave-data
                   old_size new_size compress
  experiment.RData    689Kb    447Kb    bzip2

Could save and R CMD check consistently agree on a suitable compression scheme? Could R CMD check not emit warnings if the data is already small and the alternative compression doesn't reduce the size much, such as for this example? Perhaps it could only emit warnings when the data file is more than 5 MB and the alternative scheme's resulting file is 50% or more than the size of the existing file. There is also no explanation in Section 1.1.6 Data in Packages of Writing R Extensions that compression of data files is implicitly mandatory for R packages to pass the checking process these days.

Dario Strbenac
University of Sydney
Camperdown NSW 2050

More information about the R-devel mailing list