0

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.

JoeBird
  • 65
  • 1
  • 10
  • Does this stackoverflow answer help? https://stackoverflow.com/questions/28432607/pandoc-version-1-12-3-or-higher-is-required-and-was-not-found-r-shiny/29710643#29710643 – yen Oct 16 '20 at 22:32
  • Thanks for sharing the post. I did see it but I'm not using RStudio on Linux. Moreover, I do not seem to find the (or an).Renviron file in my Linux folders. – JoeBird Oct 16 '20 at 22:58
  • Chances are that your Linux distribution provides installation packages for pandoc. On Debian based systems it should be sufficient to issue the command sudo apt install pandoc. – Johannes Ranke Oct 16 '20 at 23:23
  • Pandoc is indeed installed in my linux folder, I just don't know how to get r to use/recognize/find it in the context of rmarkdown::render. – JoeBird Oct 16 '20 at 23:35

0 Answers0