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

2021-03-04 Thread Rolf Turner
On Thu, 4 Mar 2021 12:09:51 +0100
Sebastian Meyer  wrote:



> Am 04.03.21 um 10:24 schrieb Rolf Turner:



> > But this still leaves the question:  Why the  is
> > R CMD check telling me to use the flag --resave-data, when I *just
> > did that*???
> 
> Yes, indeed! I've investigated further and found that in R 4.0.0-4.0.4
> the --resave-data option of R CMD build was ineffective for packages
> using LazyData. This bug has recently been fixed in R-devel (c79573)
> and I think the fix should also be ported to R-patched and appear in
> the NEWS.
>
> Thank you for reporting!

Ta-da!!!  So I'm not going mad after all!!! :-)

Thanks very much for invetools::resaveRdaFiles(),stigating and
reassuring me.  Thanks also for pointing out the tools::resaveRdaFiles()
workaround which provided an interim fix for the problem.

cheers,

Rolf Turner

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


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

2021-03-04 Thread Sebastian Meyer
Am 04.03.21 um 10:24 schrieb Rolf Turner:
> 
> On Thu, 4 Mar 2021 08:44:31 +0100
> Sebastian Meyer  wrote:
> 
>> 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?
> 
> The former.  I have never used devtools::check().
>>
>>>
>>> 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"?
> 
> Dunno what you mean by the "R CMD build log".  I could grepped
> "re-saving" on all files and came up empty handed.

I meant the standard output of R CMD build.
With --resave-data, it should show something like

* checking for empty or unneeded directories
* re-saving image files
* building '.tar.gz'

> 
>> - Have you set the BuildResaveData field in your DESCRIPTION file?
> 
> No.
> 
>> This would take precedence over the --resave-data command line switch.
>>
>> - Have you tried running ) on your source data
>> directory before building the package? Does that reduce the size of
>> your data files?
> 
> Never heard of that.  Tried it just now and it reduced the size from
> 285607 bytes to 161743 bytes.  That's substantial I guess.
> 
> 
> 
>> 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).
> 
> Now that I have applied tools::resaveRdaFiles(), I no longer get
> the NOTE from R CMD check.  So I guess my problem is solved.  Thanks.
> 
> But this still leaves the question:  Why the  is
> R CMD check telling me to use the flag --resave-data, when I *just did
> that*???

Yes, indeed! I've investigated further and found that in R 4.0.0-4.0.4
the --resave-data option of R CMD build was ineffective for packages
using LazyData. This bug has recently been fixed in R-devel (c79573) and
I think the fix should also be ported to R-patched and appear in the NEWS.

Thank you for reporting!

Best regards,

Sebastian

> 
> cheers,
> 
> Rolf
>

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


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

2021-03-04 Thread Rolf Turner


On Thu, 4 Mar 2021 08:44:31 +0100
Sebastian Meyer  wrote:

> 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?

The former.  I have never used devtools::check().
> 
> > 
> > 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"?

Dunno what you mean by the "R CMD build log".  I could grepped
"re-saving" on all files and came up empty handed.

> - Have you set the BuildResaveData field in your DESCRIPTION file?

No.

> This would take precedence over the --resave-data command line switch.
> 
> - Have you tried running ) on your source data
> directory before building the package? Does that reduce the size of
> your data files?

Never heard of that.  Tried it just now and it reduced the size from
285607 bytes to 161743 bytes.  That's substantial I guess.



> 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).

Now that I have applied tools::resaveRdaFiles(), I no longer get
the NOTE from R CMD check.  So I guess my problem is solved.  Thanks.

But this still leaves the question:  Why the  is
R CMD check telling me to use the flag --resave-data, when I *just did
that*???

cheers,

Rolf

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


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

2021-03-03 Thread Sebastian Meyer
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
>

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


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

2021-03-03 Thread 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!

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?

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!

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

-- 
Honorary Research Fellow
Department of Statistics
University of Auckland
Phone: +64-9-373-7599 ext. 88276

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel