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


Re: [R-pkg-devel] Using the amsmath package in a vignette.

2021-03-03 Thread Göran Broström

Hi Rolf,

On 2021-03-04 03:51, Rolf Turner wrote:


I am trying to create a vignette in a package (basically just using 
LaTeX code; no R calculations or data are involved).


The LaTeX code involves the use of the align* environment from the
amsmath package.  When I try to run Sweave() on the *.Rnw file I get
a corresponding *.tex file, but then when I run pdflatex on that file
I get an error:


! LaTeX Error: Command \iint already defined. Or name \end...
illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation. Type  H
  for immediate help. ...

l.649 ...d{\iint}{\DOTSI\protect\MultiIntegral{2}}


which is completely opaque to me.


Shouldn't be; the amsmath package defines \iint, and the error message 
says that it was already defined, probably in another package you have 
loaded. Easily found by googling. My first hit was


https://tex.stackexchange.com/questions/356599/command-iint-already-defined

If I don't have \usepackage{amsmath} in the *.Rnw file, I get 
(unsurprisingly) an error message to the effect that the align* 
environment is undefined.


Is there any way to make use of amsmath facilities in a vignette?


Absolutely, I am doing it with no problem. I have in one preamble


\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
% \VignetteIndexEntry{Parametric duration models}
\newcommand{\btheta}{{\ensuremath{\boldsymbol{\theta
\newcommand{\bbeta}{{\ensuremath{\boldsymbol{\beta
\newcommand{\bz}{\ensuremath{\mathbf{z}}}
and so forth



Alternatively, is there any way to simply use the pdf output
obtained by processing an ordinary LaTeX file as a vignette?  I have
done a bit of web searching on this, but all of the hits that I get
seem to be substantially out of date.  They refer to putting
vignettes in /inst/doc and I'm pretty sure that this is no longer how
it's done. (But I find all of the vignette business rather
bewildering and confusing.)

Grateful for any advice.


Have you read the "Writing R Extensions"? There 'inst/doc' is mentioned 
under 'Non-Sweave vignettes'.


Best, Göran Broström


cheers,

Rolf Turner



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


Re: [R-pkg-devel] Using the amsmath package in a vignette.

2021-03-03 Thread Ott Toomet
As I read the docs (a few months ago though), you are supposed to include
the pdf and encouraged to include sources, but the process to get pdf from
source may depend on your private libraries/data/software, and is not
replicated on CRAN checks.  This seemed to work for me as my vignette
includes a less common .bst.  I sort of remember receiving errors about
missing .bst from rhub, but it definitely ran on CRAN with no red flags
raised.

On Wed, Mar 3, 2021 at 9:37 PM Henrik Bengtsson 
wrote:

> The R.rsp has a vignette engine for plain LaTeX sources. See
>
> https://cran.r-project.org/web/packages/R.rsp/vignettes/R_packages-LaTeX_vignettes.pdf
> for how. It's straightforward. Maybe that helps.
>
> Henrik
>
> On Wed, Mar 3, 2021, 18:51 Rolf Turner  wrote:
>
> >
> > I am trying to create a vignette in a package (basically just using
> > LaTeX code; no R calculations or data are involved).
> >
> > The LaTeX code involves the use of the align* environment from
> > the amsmath package.  When I try to run Sweave() on the *.Rnw file
> > I get a corresponding *.tex file, but then when I run pdflatex on
> > that file I get an error:
> >
> > > ! LaTeX Error: Command \iint already defined.
> > >Or name \end... illegal, see p.192 of the manual.
> > >
> > > See the LaTeX manual or LaTeX Companion for explanation.
> > > Type  H   for immediate help.
> > >  ...
> > >
> > > l.649 ...d{\iint}{\DOTSI\protect\MultiIntegral{2}}
> >
> > which is completely opaque to me.
> >
> > If I don't have \usepackage{amsmath} in the *.Rnw file, I get
> > (unsurprisingly) an error message to the effect that the align*
> > environment is undefined.
> >
> > Is there any way to make use of amsmath facilities in a vignette?
> >
> > Alternatively, is there any way to simply use the pdf output obtained
> > by processing an ordinary LaTeX file as a vignette?  I have done a
> > bit of web searching on this, but all of the hits that I get seem to be
> > substantially out of date.  They refer to putting vignettes in
> > /inst/doc and I'm pretty sure that this is no longer how it's done.
> > (But I find all of the vignette business rather bewildering and
> > confusing.)
> >
> > Grateful for any advice.
> >
> > 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
> >
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
>

[[alternative HTML version deleted]]

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


Re: [R-pkg-devel] Using the amsmath package in a vignette.

2021-03-03 Thread Henrik Bengtsson
The R.rsp has a vignette engine for plain LaTeX sources. See
https://cran.r-project.org/web/packages/R.rsp/vignettes/R_packages-LaTeX_vignettes.pdf
for how. It's straightforward. Maybe that helps.

Henrik

On Wed, Mar 3, 2021, 18:51 Rolf Turner  wrote:

>
> I am trying to create a vignette in a package (basically just using
> LaTeX code; no R calculations or data are involved).
>
> The LaTeX code involves the use of the align* environment from
> the amsmath package.  When I try to run Sweave() on the *.Rnw file
> I get a corresponding *.tex file, but then when I run pdflatex on
> that file I get an error:
>
> > ! LaTeX Error: Command \iint already defined.
> >Or name \end... illegal, see p.192 of the manual.
> >
> > See the LaTeX manual or LaTeX Companion for explanation.
> > Type  H   for immediate help.
> >  ...
> >
> > l.649 ...d{\iint}{\DOTSI\protect\MultiIntegral{2}}
>
> which is completely opaque to me.
>
> If I don't have \usepackage{amsmath} in the *.Rnw file, I get
> (unsurprisingly) an error message to the effect that the align*
> environment is undefined.
>
> Is there any way to make use of amsmath facilities in a vignette?
>
> Alternatively, is there any way to simply use the pdf output obtained
> by processing an ordinary LaTeX file as a vignette?  I have done a
> bit of web searching on this, but all of the hits that I get seem to be
> substantially out of date.  They refer to putting vignettes in
> /inst/doc and I'm pretty sure that this is no longer how it's done.
> (But I find all of the vignette business rather bewildering and
> confusing.)
>
> Grateful for any advice.
>
> 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
>

[[alternative HTML version deleted]]

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


[R-pkg-devel] Using the amsmath package in a vignette.

2021-03-03 Thread Rolf Turner


I am trying to create a vignette in a package (basically just using
LaTeX code; no R calculations or data are involved).

The LaTeX code involves the use of the align* environment from
the amsmath package.  When I try to run Sweave() on the *.Rnw file
I get a corresponding *.tex file, but then when I run pdflatex on
that file I get an error:

> ! LaTeX Error: Command \iint already defined.
>Or name \end... illegal, see p.192 of the manual.
> 
> See the LaTeX manual or LaTeX Companion for explanation.
> Type  H   for immediate help.
>  ...  
>   
> l.649 ...d{\iint}{\DOTSI\protect\MultiIntegral{2}}

which is completely opaque to me.

If I don't have \usepackage{amsmath} in the *.Rnw file, I get
(unsurprisingly) an error message to the effect that the align*
environment is undefined.

Is there any way to make use of amsmath facilities in a vignette?

Alternatively, is there any way to simply use the pdf output obtained
by processing an ordinary LaTeX file as a vignette?  I have done a
bit of web searching on this, but all of the hits that I get seem to be
substantially out of date.  They refer to putting vignettes in
/inst/doc and I'm pretty sure that this is no longer how it's done.
(But I find all of the vignette business rather bewildering and
confusing.)

Grateful for any advice.

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


[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