title: Calling R script from python using rpy2
body: <p>I'm very new to rpy2, as well as R.</p>
  
  <p>I basically have a R script, script.R, which contains functions, such as rfunc(folder). It is located in the same directory as my python script. I want to call it from Python, and then launch one of its functions. I do not need any output from this R function. I know it must be very basic, but I cannot find examples of R script-calling python codes.
  What I am currently doing, in Python:</p>
  
  <pre><code>import rpy2.robjects as robjects
  
  def pyFunction(folder):
      #do python stuff 
      r=robjects.r
      r[r.source("script.R")]
      r["rfunc(folder)"]
      #do python stuff
  
  pyFunction(folder)
  </code></pre>
  
  <p>I am getting an error on the line with source:</p>
  
  <p><code>r[r.source("script.R")]
    File "/usr/lib/python2.7/dist-packages/rpy2/robjects/__init__.py", line 226, in __getitem__
      res = _globalenv.get(item)
  TypeError: argument 1 must be string, not ListVector</code></p>
  
  <p>I quite do not understand how the argument I give it is not a string, and I guess the same problem will then happen on the next line, with <em>folder</em> being a python string, and not a R thingie.</p>
  
  <p>So, how can I properly call my script?</p>