title: How can an R variable be passed to a system call for a python function?
body: <p>I have written a function in python that takes two arguments one of which is a file path name. I have wrapped the call to this python function within a loop in R. I want to be able to update a variable in this R for loop and pass the value of this variable to the python function as the file path name. How can I do this?</p>
  
  <p>R code:</p>
  
  <pre><code>for (file in filenames) {
       file &lt;- paste("/home/yyy/xx", file, sep="/")
       system('python pylib/filefunction.py &lt;TODO: file&gt; divide') # divide is the 2nd argument
  }
  </code></pre>