title: executing an R script from python
body: <p>I have an R script that makes a couple of plots.  I would like to be able to execute this script from python.</p>
  
  <p>I first tried:</p>
  
  <pre><code>import subprocess
  subprocess.call("/.../plottingfile.R", shell=True)
  </code></pre>
  
  <p>This gives me the following error:</p>
  
  <pre><code>/bin/sh: /.../plottingfile.R: Permission denied
  126
  </code></pre>
  
  <p>I do not know what the number 126 means.  All my files are on the Desktop and thus I do not think that any special permissions would be needed?  I thought that this error may have had something to do with cwd = none but I changed this and I still had an error.</p>
  
  <p>Next I tried the following:</p>
  
  <pre><code>subprocess.Popen(["R --vanilla --args &lt;/.../plottingfile.R&gt;"], shell = True)
  </code></pre>
  
  <p>But this too gave me an error with:</p>
  
  <pre><code>/bin/sh: Syntax error: end of file unexpected.
  </code></pre>
  
  <p>Most recently I tried:</p>
  
  <pre><code>subprocess.Popen("konsole | /.../plottingfile.R", shell = True)
  </code></pre>
  
  <p>This opened a new konsole window but no R script was ran.  Also, I received the following error:</p>
  
  <pre><code>/bin/sh: /.../plottingfile.R: Permission denied
  </code></pre>
  
  <p>Thanks.</p>