R CMD Check and Non-PDF Vignettes

packages random-code-snippets

R CMD Check complaining about missing files? Here was my solution.

Robert M Flight true
10-27-2021

R CMD Check

If you’ve written an R package that you want hosted by CRAN (or even if not hosted), then you generally want to run the infamous R CMD check on your package.

Although it can be a pain in the butt, it has a wide array of checks that make sense (and some that don’t, just look at posts on the R-devel list).

Missing Files

If you are using rmarkdown to generate non-standard vignettes, or even using rmarkdown because of features that aren’t present directly in knitr, then the check process may fail after it re-builds the package. You may see this message:

Warning: Files in the 'vignettes' directory but no files in 'inst/doc':
  ‘vignette_file.Rmd’

The solution, as far as I can tell, is to:

I think that the build command only recognizes the knitr engine properly, and that is the only one that builds the vignettes and shoves them in the right location.

Otherwise, you should build them manually and double check the options to build and check so that vignettes don’t get rebuilt during either build or check.

Depending on your needs, you might want to use something like Drew Schmidt’s approach (“Vignette-Less Articles with Pkgdown” 2020).

“Vignette-Less Articles with Pkgdown.” 2020. https://fml-fam.github.io/blog/2020/06/23/vignette-less-articles-with-pkgdown/.

References

Corrections

If you see mistakes or want to suggest changes, please create an issue on the source repository.

Reuse

Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Source code is available at https://github.com/rmflight/researchBlog_distill, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

Citation

For attribution, please cite this work as

Flight (2021, Oct. 27). Deciphering Life: One Bit at a Time: R CMD Check and Non-PDF Vignettes. Retrieved from https://rmflight.github.io/posts/2021-10-27-r-cmd-check-and-non-pdf-vignettes/

BibTeX citation

@misc{flight2021r,
  author = {Flight, Robert M},
  title = {Deciphering Life: One Bit at a Time: R CMD Check and Non-PDF Vignettes},
  url = {https://rmflight.github.io/posts/2021-10-27-r-cmd-check-and-non-pdf-vignettes/},
  year = {2021}
}