I have a .rmd script "MainScript.rmd" that refers to a second script "SubScript.rmd" through render() , to create a html file, as such:
render("SubScript.rmd", output_dir = "./Results/", output_file = paste0(species,"_SeasonOverlap.html"))
This works great in RStudio on my windows computer. However, I would like to run those same scripts on linux (without RStudio) through a powershell script. I have been able to run r scripts through .sh using:
Rscript MainScript.r
But have not been able to run a .rmd script. Even when I convert MainScript to a .r (instead of .rmd), I can't get past running the line render(). I get the following error message:
Error: pandoc version 1.12.3 or higher is required and was not found (see the help page ?rmarkdown::pandoc_available).
I have downloaded pandoc on the linux (now found under "/nfs/stak/users/jobird/pandoc") but I don't know how to make my MainScript.r recognize where pandoc is, or even if that is what I need to do. I have little experience with linux.
My goal is to create a html document through running the SubScript.rmd program, from the MainScript.r, on linux.