I'm using Rstudio and devtools to build vignettes for an R packge.
All vignettes are in the /vignettes
directory. However, when I run R CMD check
I get a warning:
> checking files in 'vignettes' ... WARNING
Files in the 'vignettes' directory but no files in 'inst/doc':
'my_package_vignette.Rmd'
I can use devtools::build_vignettes()
to build each vignette, but it does not create a copy of the vignette in inst/doc
, where I understand browseVignettes("my.package")
will look.
I would like my vignettes to be discoverable by `browseVignettes("my.package").
I found this issue, and this "solution":
tools::buildVignettes(dir = ".", tangle=TRUE)
dir.create("inst/doc")
file.copy(dir("vignettes", full.names=TRUE), "inst/doc", overwrite=TRUE)
Unfortunately, when I run R CMD check
in Rstudio, it erases the inst/doc
directory.
I have seen this issue, but none of the solutions resolve my question.
How do I build package vignettes in Rstudio so that they are discoverable by browseVignettes()
?