0

I am trying to run this R script with R Studio specifically from the command line. I was able to launch R Studio and open the script with the following command:

"PATH TO rstudio.exe" "PATH TO R FILE"

Is there a command that I can add to this line (if yes, where) to not only just launch and open the script but execute it as well?

Thank you!

dtsui
  • 29
  • 1
  • 9
  • 1
    Do you need it to display in RStudio or is the goal just to run the file? If you just need to run it then using Rscript might make more sense -https://stackoverflow.com/questions/18306362/run-r-script-from-command-line/18306656#18306656 – Dason Sep 18 '17 at 22:45
  • I just need to run it but the problem is, if I use Rscript, it halts execution whenever I run into an error in the script (it's a very long script with a lot of errors that don't matter). RStudio simply skips over these errors so I was trying to call RStudio specifically from command line. Thanks! – dtsui Sep 19 '17 at 12:45
  • 1
    So this is an XY problem. Your actual question is "How to get RScript to keep running even if it comes across an error"? – Dason Sep 19 '17 at 15:01
  • Yes and I know that RStudio can solve that problem so I decided to ask how to launch and run an R script with RStudio from the command line. – dtsui Sep 19 '17 at 18:51
  • In `options` look at the 'error' option. You can set your own function that doesn't exit to allow you to continue if there is an error. – Dason Sep 19 '17 at 19:29
  • Are you saying that I can add a flag or something when running the script with Rscript so that it skips through the errors? – dtsui Sep 19 '17 at 21:04

0 Answers0