3

I have a package, lovingly documented with a html vignette using Rmarkdown and knitr. The package builds and works fine (on Windows). The vignette separately runs and renders with no problems. I can build a binary package with no problem.

But when I try to build a source package, I consistently run into this error:

Warning: running command '"C:/PROGRA~1/R/R-33~1.0/bin/x64/Rscript" --vanilla --default-packages= -e "tools::buildVignettes(dir = '.', tangle = TRUE)"' had status 1
Error: Command failed (1)

I have run the command tools::buildVignettes(dir = '.', tangle = TRUE) separately in the console. Works fine.

Following advice in other threads, I have updated evaluate, knitr, rmarkdown, etc.

Any ideas how to debug this?

I have built packages with vignettes before, albeit generating pdf vignettes rather than html.

This question dovetails with a more general confusion about how vignettes are really being built using the knitr/rmarkdown workflow (in Rstudio). Having read much documentation (and stackoverflow threads), my understanding was that an rmd file in the vignettes directory would generate the html in the inst/doc directory. That doesn't seem to happen - in an internal build [Ctrl-Shift-B], I can only get that vignette to work if I manually copy those files to inst/doc. Where exactly is the build process told to generate and copy those vignettes?

elzizi
  • 310
  • 1
  • 8
  • 1
    Are you looking for devtools::build_vignettes()? – Peter Ellis Dec 27 '16 at 20:28
  • I see devtools::build_vignettes() compiles the vignette and moves it to doc/inst, but the error in the build remains. Maybe there's a way to tell the R source builder to use build_vignettes instead of "buildVignettes" - though the difference between the two escapes me. – elzizi Dec 27 '16 at 21:22
  • 1
    ... and then it worked. With no apparent explanation. Very cryptic all of this. But, to recap, you do have to "manually" build the vignette first [which places it in doc/inst], and the source build will work? Even though - apparently - the build command is supposed to build the vignettes itself? And even though the buit vignette, previously, was there? Anyways - you do what you do which is be glad it worked and move on with your life without looking too closely. – elzizi Dec 27 '16 at 21:33
  • Even though the devtools::build() command is supposed to build the vignettes... yes, according to http://r-pkgs.had.co.nz/vignettes.html (under Development cycle). But it didn't work in my experience (yesterday 2017-03-07, running devtools version 1.12.0) when I modified an already existing vignette. I had to run devtools::build_vignettes() to get the files under inst/doc/ to update (and reflect the changes in the source under vignettes/). I ran devtools::build() afterwards, and then could move on with my life. :) – mkcor Mar 08 '17 at 15:29

0 Answers0