title: How to run R script in python using rpy2
body: <p>My question seems very basic but I don't find an answer even on rpy2 documentation.
  I have *.R script that accept one argument as &quot;file.txt&quot; (I need to pass the argument not from the command line). I want to call the R script inside a python script . My questions is:
  How to pass and recuperate the arguments to the R script ?
  My solution is :
  suppose that the R script is start by this line:</p>
  <pre class="lang-r prettyprint-override"><code>df &lt;- read.table(args[1], header=FALSE)
  &quot;
   here args[1] should be the file which is not passed from the command line
  &quot;
  ....
  </code></pre>
  <p>Now I write a function in my python script:</p>
  <pre><code>from rpy2 import robjects as ro
  def run_R(file):
      r = ro.r
      r.source(&quot;myR_script.R&quot;)
     # how to pass the file argument to
     # the R script and how to
     # recuperate this argument in the R code?
  </code></pre>