I have figured out how to open R studio and the specific script using only windows command prompt. But I cannot figure out how to actually run the script once its open from the command line. I need a command for the windows command prompt that runs an R script. Is there a way to either pass through Ctrl + A & Ctrl + Enter keystrokes or to hit run in Rstudio by only using the windows command prompt? I want to turn it into a batch file that I can run through the windows task scheduler.
Asked
Active
Viewed 473 times
0
-
A simple search on SO or Google probably would have told you to use `rscript.exe`. – Squashman Apr 24 '18 at 18:12
-
Currently in the windows command prompt I change my directory and then have: start Rstudio start rscript.R This opens R studio and the specific script. What next line do I need to make it run? I tried entering rscript.exe and it says its not recognizable as an internal or external command, operable program or batch file... So that doesn't solve my question. I've also read the article you suggest as duplicate, and I see no correlation to what I am trying to do. – mcunkelman Apr 24 '18 at 19:02
-
`start "Window Title" "C:\path to r\rscript.exe" "C:\path to script\script.r"` – Squashman Apr 24 '18 at 19:17
-
1I ran the line C:\>start "Window Title" "C:\Program Files\R\R-3.4.2\bin\Rscript.exe" "C:\Users\CunkelmanM\Docu ments\2015\R Scripts\Cygnet_Production_String.R" As you suggest and all it does is open another command prompt window for a few seconds and then it closes... but the r script still doesn't run. – mcunkelman Apr 24 '18 at 19:39