Vignettes Suddenly Stopped Installing

I've been developing an R package for the past several months using RStudio. In the package I've been keeping the Vignette updated. I push it to a private GitHub repository so that my collaborator can then install it on his PC using:

install_github(_package name_, build_vignettes = TRUE)

He then runs

vignette(_package name_)

to read the vignette for examples of new functionality.

That's worked well until the past month when he last checked out the package. Now the vignette() command throws a "vignette not found" warning.
When I build the package locally and look where RStudio installs the packages, I don't see a /doc directory. It now appears that the vignette is not being installed. Running knitr on the .RMD file works fine. I can even run

devtools::build_vignettes()

with no errors and the .html file is generated from the vignette. For some reason, building and installing the package no longer installs the vignette.

I haven't changed any build options during the package development. I've only update .R files and the vignette .RMD file. I haven't changed any markup at the top of the .RMD file.

I've searched the forums to see what I could have done to cause the vignette to stop being installed with the package but I haven't come across anything. Do anyone have any suggestions on how to resolve this?

Since devtools 2.0.0 update, there are some changes in behaviour.

The function devtools::install_github is now using remotes::install_github. This function has no build_vignettes = TRUE argument and by default vignette is not built.

However, there is a build_opts argument controlling the build process. By default, you'll see in help page that this argument contains by defaut --no-build-vignettes. You can remove this options to get the vignettes.

So the workaround with the new version is

remotes::install_github(..., build = TRUE, build_opts = c("--no-resave-data", "--no-manual")
# or with devtools >= 2.0.0
devtools::install_github(..., build = TRUE, build_opts = c("--no-resave-data", "--no-manual")

currently, there are some discussions on this new behaviour for devtools

3 Likes

Thanks for the suggestion. That solved the problem!
Is there a way to have RStudio/devtools install the vignette locally (on the machine where the package is being developed)?

Sorry but I am not sure to understand the question. Do you mean install a vignette during :package: development ?