I want to be able to call R files from python using the rpy2 modules. I would like to be able to pass arguments to these scripts that can be interpreted by R's commandArgs function.
So if my R script (trivial_script.r) looks like:
print(commandArgs(TRUE))
and my Python 2.7 script looks like:
>>> import rpy2.robjects as robjects
>>> script = robjects.r.source('trivial_script.r')
How can I call it from rpy2.robjects with the arguments "arg1", "arg2", "arg3" ?