I have some R code inside a file called analyse.r. I would like to be able to, from the command line (CMD), run the code in that file without having to pass through the R terminal and I would also like to be able to pass parameters and use those parameters in my code, something like the following pseudocode:
C:>(execute r script) analyse.r C:file.txt
and this would execute the script and pass "C:file.txt" as a parameter to the script and then it could use it to do some further processing on it.
How do I accomplish this?
See Question&Answers more detail:os