[R-pkg-devel] Process for building vignettes during a CRAN package submission
Anderson,Brooke
Brooke.Anderson at colostate.edu
Wed Jan 25 19:17:28 CET 2017
I am creating a package with a 'Suggests' dependency on a second package hosted in a drat repository on GitHub. I have listed the second package in 'Suggests' of the DESCRIPTION file for the first package and listed the drat repository in 'Additional_repositories'. I have made all code in the vignette and examples conditional on the availability of the second repository using `requireNamespace`, with the `quietly` option set to TRUE, so code is skipped if the package is built on a system that does not have the second package loaded. This package is passing all CRAN checks on my computer and only gets a single NOTE on win-builder about "Suggests or Enhances not in mainstream repositories", so I'm happy with the package set-up in terms of passing checks.
My one concern is what the vignette that users who install the package from CRAN will look like. If I build the vignette on my computer, with the second package installed, the vignette looks as I would like it to for users, since all the examples are run. However, if the vignette is built on a system without the second package installed, the vignette is pretty boring since most examples are skipped. I have a question about the CRAN submission process related to vignette building that will help me clarify this concern.
Based on reading through "Writing R Extensions", this is what I think happens with a vignette and its code during the CRAN submission process:
1. Before submitting the package to CRAN, the package maintainer builds and checks the package locally. When the package is built locally, any vignettes are built in pdf and / or html files. These files are stored in the package's `\inst\doc` directory. This directory (`inst\doc`) is packaged with other package elements else in the .tar.gz file. Everything in .tar.gz is sent to CRAN.
2. When the package is sent to CRAN, CRAN tries running all of the code in the examples and vignette. However, CRAN does not rebuild the vignette.
3. Once the package is on CRAN, CRAN regularly checks the package. To do this, CRAN tries running all of the code in the examples and vignette. However, again, CRAN does not rebuild the vignette. Instead, the vignette that is sent out to users continues to be the one built by the package maintainer when he or she first submitted the package .tar.gz to CRAN.
Have I understood this process, particularly #2, correctly? Or will CRAN rebuild the vignette during the submission process and replace the .html or .pdf version of the vignette that is passed to users who install the package from CRAN?
[[alternative HTML version deleted]]
More information about the R-package-devel
mailing list