Skip to content

[R-pkg-devel] R CMD build --resave-data not working

5 messages · Jonathan Callahan, Ben Bolker, Sebastian Meyer +1 more

#
I am building a package using R 4.0.4 on OS X 10.15.7.

In a terminal I type:

R CMD build --resave-data AirSensor

Then, I check with:

R CMD check --as-cran AirSensor_1.0.8.tar.gz

Everything is fine until I see:


* 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

  example_pas.rda              1.6Mb    1.1Mb       xz

  example_pas_raw.rda          114Kb     86Kb       xz

  example_pat.rda              965Kb    444Kb       xz

  example_pat_failure_A.rda    527Kb    259Kb       xz

  example_pat_failure_B.rda    411Kb    198Kb       xz

  example_sensor_scaqmd.rda    108Kb     76Kb       xz

I get the same WARNING if I submit to win-builder.R-project.org.

I've built many packages in the past and am currently stumped as to what
might be happening.
#
maybe R CMD build --resave-data=best   ... ?
On 3/11/21 3:57 PM, Jonathan Callahan wrote:
#
Hmm, I may have written too quickly.  I find these lines from R CMD 
build --help confusing:


  --resave-data=        re-save data files as compactly as possible:
                         "no", "best", "gzip" (default)
   --resave-data         same as --resave-data=best

The first line suggests that gzip compression is the default.  The 
second suggests that "best" is the default.  And are we supposed to use 
quotation marks or not ... ?

   In any case, --resave-data=best and --resave-data="best" both seem 
worth a try.
On 3/11/21 3:57 PM, Jonathan Callahan wrote:
#
This is a bug in R 4.0.0 - R 4.0.4 affecting packages using LazyData.

Two possible workarounds:

- Manually run tools::resaveRdaFiles() on your data directory before
building the package.

- Use a current development version of R (4.0.4-patched >= r80069 or
R-devel >= r79573)

Best regards,

	Sebastian Meyer


PS: This is a duplicate of a recent discussion on this list, see
https://stat.ethz.ch/pipermail/r-package-devel/2021q1/006643.html



Am 11.03.21 um 21:57 schrieb Jonathan Callahan:
#
On Thu, 11 Mar 2021 12:57:00 -0800
Jonathan Callahan <jonathan at mazamascience.com> wrote:

            
I had the same problem, and asked about it some time back (c. 4
March) and was informed by Sebastian Meyer that:
A temporary workaround (again, thanks to Sebastian Meyer) is to run

    tools::resaveRdaFiles()

on your data directory prior to building.

cheers,

Rolf Turner