0

It makes a moment for which I look if it's possible to launch/execute a file rmd ( markdown ) from R without using RStudio. Because I have constraints in the work: I cannot use Rstudio.

I have examine but everybody uses use Markdown since Rstudio.

Converting Rmarkdown to PDF without RStudio

pogibas
  • 27,303
  • 19
  • 84
  • 117
Sldx
  • 1
  • 1
  • 2
    `rmarkdown::render(filename)`? If your Rmd file is intended to be interactive (e.g., uses `shiny`) and if that doesn't work, then perhaps you could provide a MWE. Further, as I reread the question, the question *"from where"* comes to mind: are you doing this from Rterm (or Rgui), or are you hoping to launch it from the OS? (If the latter, perhaps `Rscript -e rmarkdown::render(filename)`.) – r2evans Nov 29 '18 at 17:28
  • Thanks for your feedback, What do you mean by "if your rmd is intented to be ineractive"? MWE? I do not know that term. Can you tell me more ? We want to run the rmd file from Rgui and we use Windows. Knowing that we have already executed the Rmd file in Rgui using the "rmarkdown :: render (filename)" instruction and we got the error: "Error: Pandoc version 1.12.3 or higher is required and not found (see the help page? Rmarkdown :: pandoc_available)." We have tried to download pandoc but pandoc is not downloadable in R version (3.4.4 / 3.4.1). – Sldx Nov 30 '18 at 09:40
  • [MWE](https://en.wikipedia.org/wiki/Minimal_working_example) = *"minimum working example"*, (refs: https://stackoverflow.com/questions/5963269, https://stackoverflow.com/help/mcve, and https://stackoverflow.com/tags/r/info). Interactive: is it a one-time run and save the output, or does it use `shiny` components? Since you aren't using RStudio, you need to manually install [pandoc](https://pandoc.org/) and make sure it is in the `PATH` (at least for R, perhaps using `~/.Renviron` or `~/.Rprofile` or similar). – r2evans Nov 30 '18 at 16:48
  • I use it in interactive mode, my rmd file uses excel data sources, and then when it has retrieved the data, the file rmd will then output an .docx file. Regarding pandoc, I have to download it on the link, then I create the environment path variable of the windows is it? ( I do not understand about Rprofile and Renviron ) – Sldx Dec 06 '18 at 12:37
  • *"pandoc is not downloadable in R version (3.4.4/3.4.1)"*, not sure what you mean ... it's released [on its own](http://pandoc.org/installing.html) and included within RStudio. In my version of RStudio, I have pandoc-1.19.2.1 installed, and that worked with R-3.4.4, so that's safe. Pandoc is now at v2.5, not sure if it's been tested with `rmarkdown`, some research would be beneficial. Regardless, if `pandoc` is in your `PATH`, `rmarkdown::render` should work (and not give you that error), no RStudio required. But that error is key to you right now: nothing else is relevant until that is fixed. – r2evans Dec 06 '18 at 17:48

0 Answers0