I'm trying to run an R file from the command line (from Terminal -- on macOS 10.13.3).
Following the directions in this helpful Q & A, I added #! [path/to/file.R]
as the first line of the R file.
When I then type Rscript [path/to/file.R]
in Terminal, a part of the file to test that it worked seems to run (I added a print()
statement), however, the next line:
rmarkdown::render_site(output_format = 'bookdown::pdf_book', encoding = 'UTF-8')
Leads to this error:
Error in rmarkdown::render_site(output_format = "bookdown::pdf_book", :
No site generator found.
Why does the print()
statement appear to work fine, but this line - to render a bookdown book - does not?
The file I'm trying to run is on GitHub here.