user101089
user101089

Reputation: 3992

R package warning: Files in the 'vignettes' directory newer than all files in 'inst/doc'

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?

Upvotes: 3

Views: 1375

Answers (1)

user101089
user101089

Reputation: 3992

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.

Upvotes: 5

Related Questions