I currently have a project designed around one master Rmarkdown file (called full_document.Rmd
), that in turn calls a series of other Rmarkdown files to render the whole document. As it's a complicated build process, I've automated the whole thing with a makefile. This has worked fine on another computer (running Windows 2010). However, I've tried re-running the makefile on a new PC (Windows 10), and it's running into a makefile specific error.
The makefile will run as expected until in encounters this line:
R --vanilla --slave -e "rmarkdown::render('paper_sections/full_document.Rmd',output_file = 'full_document.pdf')"
At which point, it returns this error message:
Error: object 'rmarkdown' not found
Execution halted
make: *** [Makefile:17: main] Error 1
Which implies that it is unable to find the rmarkdown package. However: compiling the document by just pressing knit in Rstudio works fine, so the package is installed fine. I also tried running this via the terminal in Rstudio, using the exact same command as above, and it also runs fine, which means the rmarkdown package is available to R run from the terminal. What I can't understand is why it wouldn't be usable from the process the makefile is running.
Any help on this would be really appreciated. I don't even know how to make this example reproducible, since as I said, it works fine on a different computer with basically the same setup.