19

Lately I get a warning for my vignette on Win R Development Version when doing a cran check.

Files in the 'vignettes' directory but no files in 'inst/doc'

This warning only appears with the Win Dev version. For Mac, AppVeyor and Travis no warning appears.

The problem is, I don't know what the warning wants to tell me. As far as I know I do not have to put files in inst/doc.

Here is the complete warning message:

Files in the 'vignettes' directory but no files in 'inst/doc':
'Figures.d/Rlogo.png', 'Figures.d/distribution.pdf',
'Figures.d/distributionbar.pdf', 'Figures.d/gapsize.pdf',
'Figures.d/imputations.pdf', 'Figures.d/imputations2.pdf',
'Figures.d/sponsorlogo.jpg', 'Figures.d/statsna.png',
'Figures.d/tsairgap.png', 'Introduction.pdf', 'Introduction.tex',
'RJournal.sty'

5 Answers 5

9

In my case, I was getting this issue because I had specified my YAML as per @Claudia's answer, but I had specified rmarkdown as the VignetteBuilder in the DESCRIPTION file. Using VignetteBuilder: knitr in my DESCRIPTION file fixed the problem.

6

I had a similar issue with an Rmd vignette. I fixed it by changing the YAML header of the vignette to something like this:

---
author: "Name Surname"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteEngine{knitr::knitr}
  %\VignetteIndexEntry{Title of your vignette}
  %\usepackage[UTF-8]{inputenc}
---
1
  • In r-pkgs.had.co.nz/vignettes.html the line %\usepackage[UTF-8]{inputenc} doesn't contain the % at the beginning: ` \usepackage[utf8]{inputenc}`, (I use it this way) Commented Jul 31, 2018 at 20:47
5

I fixed the problem with adding the .pdf output of my Vignette to inst/doc

Although I am not sure, if this is the supposed solution, it made the warning disappear.

1
  • 6
    yes! copying the pdf output to a folder inside the inst folder worked for me. I wonder why it doesn't happen automatically if it is a required step. Commented Aug 28, 2018 at 21:49
0

I was getting the error on more than just the Win R Development version, but for me the fix was adding markdown and knitr in the Suggests field in the DESCRIPTION file. Then, I guess it was clear to the package compiler that the vignette was designated as a markdown/HTML doc. These lines are in my markdown YAML header:

output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Example for estimating the case fatality ratio}
  %\VignetteEngine{knitr::knitr}
  \usepackage[utf8]{inputenc}

0

usethis::use_vignette() for vignette creation will take care of this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.