[R-pkg-devel] Note: significantly better compression could be obtained ...

Sebastian Meyer @eb@meyer @end|ng |rom |@u@de
Thu Mar 4 08:44:31 CET 2021


Am 04.03.21 um 01:41 schrieb Rolf Turner:
> 
> ... by using R CMD build --resave-data
> 
> But I *did* use that flag with my build command!!!  And yet "R CMD
> check" seems to think that I didn't!

Just to be sure: Are you running R CMD check on that freshly built
tarball or is devtools::check() involved?

> 
> I have done "R CMD build --resave-data kanova"  (where "kanova" is
> the name of the package in question), to make sure that I didn't
> fumble-finger somewhere, but there's no change.  I always get that
> NOTE.
> 
> How on earth can I track down what's going wrong?

- Does the R CMD build log actually show "re-saving image files" or
"re-saving sysdata.rda"?

- Have you set the BuildResaveData field in your DESCRIPTION file? This
would take precedence over the --resave-data command line switch.

- Have you tried running tools::resaveRdaFiles() on your source data
directory before building the package? Does that reduce the size of your
data files?

> 
> There is only one file "stomata.rda" in kanova/data.  The
> file was created using:
> 
>     save(stomata,file="stomata.rda",version=2)
> 
> The file stomata.rda is a *bit* on the large size; 285607 bytes
> according to "ls -l", 279Kb according to the NOTE from R CMD check.
> But that's not all that big, is it?  And anyway I *did* ask
> R CMD build to re-save it!

You'll get the NOTE when R CMD check finds that running
tools::resaveRdaFiles() on the data directory would reduce a file's size
by more than 10% with a different type of compression (if the original
size is >10KB).

Hope this helps.
Best regards,

	Sebastian Meyer

> 
> When I load stomata.rda, object.size() says that stomata uses 1611312 bytes
> of memory.
> 
> I'm running Ubuntu 20.04.2 and R version 4.0.4.
> 
> Has anyone else ever been confronted with this bizarre phenomenon?
> 
> Thanks for any tips.
> 
> cheers,
> 
> Rolf Turner
>



More information about the R-package-devel mailing list