Search code examples
rdevtools

How do I fix a “System command error” when running “devtools::build_vignettes()” in R?


I am developing a package. The “.Rmd” files already exist in the “./vignettes” folder in the root directory of the package. I want to automatically create “.html” and “.pdf” documents into./inst/doc, so run the following code:

   library("devtools") 
   build_vignettes 

Then Errors occurred:

Building PhosMap vignettes Error in (function (command = NULL, args = character(), error_on_status = TRUE, : System command error
Error in (function (command = NULL, args = character(), error_on_status = TRUE, : System command error

My R version is 3.6.0.


Solution

  • I get similar issue when run devtools::build_vignettes().

    In my case reason of this issue was that I made a mistake in namespace in the names of exported functions.

    So try to verify the package by devtools::check()

    But also you can try next:

    1. Check you PATH, there must be a path to rtools: C:\Rtools\bin\; and C:\Rtools\mingw_64\bin\.

    2. Set system environment variables BINPREF "C:/Rtools/mingw_64/bin/".