How do I run my R Markdown file from PowerShell? I want to automate my markdown file and send the report out as an email using PowerShell. I cannot use the send.mail function in R due to security purposes when trying to access the email servers, and the Rscript.exe command in Powershell will only work for the script file not the markdown file. Any suggestions?
Asked
Active
Viewed 819 times
2
-
`Rscript rmarkdown::render("sample.Rmd")` – A Gore Jul 14 '17 at 13:23
-
You may need to provide the path to `R.exe` or `Rscript.exe`, as per [this answer](https://stackoverflow.com/a/12478852/5037901). Not a big PowerShell user myself, but this is the only way it works for me: `&"c:\path\to\R.exe" -e "rmarkdown::render("sample.Rmd")"`. Note the `&` and the use of `"` and `-e`. – juan Jul 14 '17 at 14:01