Steffen Moritz
Steffen Moritz

Reputation: 7730

R check warning: Files in the 'vignettes' directory but no files in 'inst/doc'

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'

Upvotes: 19

Views: 6086

Answers (6)

John Wambaugh
John Wambaugh

Reputation: 1

R CMD check expects that you are checking out a tarball (.tar.gz file) created with R CMD build. It looks like you may have run R CMD check on your package directory.

Upvotes: 0

its.me.adam
its.me.adam

Reputation: 696

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

Upvotes: 0

Nicholas G Reich
Nicholas G Reich

Reputation: 1138

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}

Upvotes: 0

mikeck
mikeck

Reputation: 3788

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.

Upvotes: 9

Claudia
Claudia

Reputation: 1016

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}
---

Upvotes: 6

Steffen Moritz
Steffen Moritz

Reputation: 7730

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.

Upvotes: 5

Related Questions