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

5

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'
Ambulate answered 8/3, 2017 at 12:0 Comment(0)
A
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.

Ambulate answered 8/3, 2017 at 14:11 Comment(1)
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.Fashionable
O
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.

Outwork answered 23/1, 2019 at 23:2 Comment(0)
R
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}
---
Roughhouse answered 21/5, 2017 at 8:5 Comment(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)Polonium
A
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.

Ambulate answered 8/3, 2017 at 14:11 Comment(1)
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.Fashionable
C
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}

Contuse answered 7/12, 2021 at 20:42 Comment(0)
D
0

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

Dirt answered 16/11, 2023 at 21:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.