Running R Code from Command Line (Windows)
Identify where R is install. For window 7 the path could be
1.C:\Program Files\R\R-3.2.2\bin\x64>
2.Call the R code
3.C:\Program Files\R\R-3.2.2\bin\x64>\Rscript Rcode.r
You want
Rscript.exe
.You can control the output from within the script -- see
sink()
and its documentation.You can access command-arguments via
commandArgs()
.You can control command-line arguments more finely via the getopt and optparse packages.
If everything else fails, consider reading the manuals or contributed documentation