[R-pkg-devel] R CMD check not finding my vignettes

Duncan Murdoch murdoch.duncan at gmail.com
Thu Apr 20 15:41:36 CEST 2017

On 20/04/2017 4:38 AM, David Hugh-Jones wrote:
> Hi Duncan,
> Thank you very much for taking the time to look at this.
> I tried rebuilding the tar file so as to include only the .Rmd files,
> not the HTML files, in 'vignettes':
> drwxr-xr-x  0 david  staff       0 20 Apr 09:21 huxtable/vignettes/
> -rw-r--r--  0 david  staff    1633  6 Apr 16:26
> huxtable/vignettes/comparison.csv
> -rw-r--r--  0 david  staff    6697  6 Apr 14:44
> huxtable/vignettes/design-principles.Rmd
> -rw-r--r--  0 david  staff    5521  6 Apr 14:30
> huxtable/vignettes/huxreg.Rmd
> -rw-r--r--  0 david  staff   20552  6 Apr 16:19
> huxtable/vignettes/huxtable.Rmd
> -rw-r--r--  0 david  staff      22 17 Mar 00:19
> huxtable/vignettes/placeins-header.tex
> But when I run R CMD check, I still get the same warning:
> * checking package vignettes in ‘inst/doc’ ... WARNING
> Package vignettes without corresponding PDF/HTML:
>    ‘design-principles.Rmd’
>    ‘huxreg.Rmd’
>    ‘huxtable.Rmd’
> So, the warning does not seem to be related to the presence of HTML
> files in vignettes.
> I also tried manually removing .Rmd files from inst/doc (leaving them
> only in vignettes) but this still gave the same error.
> My goal here is that for package-specific reasons, I would like both pdf
> and HTML versions of my vignettes to be available (I am writing code
> that prints HTML and LaTeX tables and want my users to have examples of
> how both output formats work). This is why I build those files manually,
> and place them in inst/doc.

I suspect this will cause troubles if you give them the same base names 
as the vignettes.  You can rename them in inst/doc (e.g. to 
HTMLdesign-principles.html) and they'll be included as non-vignette 
files, but the current setup only allows for one kind of output file. 
This is unlikely to change soon, because it affects lots of assumptions 
in the code.

> Side comment: at the moment, I feel as if I am running through the
> combinatorics of including and excluding files from vignettes and
> inst/doc, without much insight into what I am doing. Would it be fair to
> say that the current system is not very easy to comprehend?

No, though I think it's fair to say it's not very flexible.  The basic 
rules are pretty easy:

- Don't put vignettes (source or output) in inst/doc/.  R CMD build 
should do that for you.
- Don't put vignette outputs in vignettes/, just put the source there.

There are ways to bend the rules that some people use (e.g. if running R 
CMD build takes too long, some people find tricky ways to copy vignette 
outputs without building them), but those are likely pretty fragile.  As 
you appear to have found.

Duncan Murdoch

More information about the R-package-devel mailing list