From the R prompt:
source('filename.R')
From the shell:
R filename.R
useful tidbits for using open source software in science
If you have some different options in your program and you want to turn them on or off, or feed your functions different arguments, then you can specify all of this from the command line.
You can read about the details of the optparser module here, but here are the basics: Continue reading ‘Sending command line options to Python scripts’