3

In an R package I have two legacy Sweave vignettes as .Rnw files. When I check the package locally (in R Studio: Build -> Check), there are no errors, or warnings, and the same thing goes when my package is checked on R-Forge using R version 3.3.1 Patched (2016-10-17 r71531).

However, when I submit the package to Win-builder (via devtools::build_win()) for checking under R devel (unstable) (2016-10-16 r71524)), I get the following warnings that I am unable to resolve:

Files in the 'vignettes' directory newer than all files in 'inst/doc':
  'fig/plot-Ortho-fm1.pdf', 'fig/plot-Ortho-fm3.pdf',
    'fig/plot-grades-can-class.pdf', 'fig/plot-grades-can-gpa.pdf',
    'fig/plot-grades-can-sex.pdf', 'fig/plot-grades-pairs.pdf',
    'fig/plot-hern-can-age.pdf', 'fig/plot-hern-can-build.pdf',
    'fig/plot-hern-can-cardiac.pdf', 'fig/plot-hern-can-pstat.pdf',
    'fig/plot-hern-pairs.pdf', 'fig/plot-jury-can1.pdf',
    ...

My package directory structure includes the vignettes in vignettes/ and the the result of devtools::build_vignettes() in inst/doc/, as follows:

...
man/
inst/
   doc/HE-examples.{pdf,R,Rnw}
   doc/repeated.{pdf,R,Rnw}
R/
vignettes/HE-examples.Rnw
         /repeated.Rnw
         /fig/   # all generated fig files

The reason that I include the generated .pdf files in inst/doc/ is that otherwise I get a warning that the .pdf files need to be compressed with qpdf, and the only way I can actually do this is to open them in Acrobat Pro and re-save as compressed PDF.

I've tried adding inst/doc to .Rbuildignore, but that generates an error. I also tried adding inst/doc/*.pdf to .Rbuildignore but that has no effect.

The warning is preventing me from submitting an update to CRAN. I don't understand why newer files in vignettes/ should be a problem, but how can I fix the warning?

user101089
  • 3,756
  • 1
  • 26
  • 53
  • Just a command: you can use the command `tools::compactPDF()` to reduce your vignettes. – J_F Oct 20 '16 at 13:59
  • I've tried this, but for some reason, it has no effect on the PDF files, even though I have `qpdf` and `gs` installed. – user101089 Oct 20 '16 at 14:44
  • Newer files in `vignettes/` are a problem because the ones in `inst/doc` are probably from some previous version of the vignette. You may have done some work on the vignette and it won't be shown to users. – user2554330 Oct 30 '16 at 16:35

1 Answers1

5

I'm posting an answer in case anyone else runs into this problem.

This problem is mentioned in this devtools issue #1348. The solution there was simply to delete all the vignette files under inst/doc. In my case, one vignette PDF file required manual compression to avoid the complaint about qpdf.

After deleting all files under inst/doc/, I re-copied the compressed PDF file, so it was now newer than the files under vignettes/

Both problems solved, and the CRAN daemon is happy.

user101089
  • 3,756
  • 1
  • 26
  • 53