title: Passing Arcpy environment variable to R from R script
body: <p>I am working with an R script and am trying to pass an environment variable from Python into a variable that I can work with in R.</p>
  
  <p>I have written a very simple python script which gets the variable I am looking for - when run as a standalone Python script it prints the path fine. Here is the very simple Python script saved as pathgetter.py:</p>
  
  <pre><code>import arcpy
  print(arcpy.env.scratchFolder)
  </code></pre>
  
  <p>I then call this Python script in my R script with the following line:</p>
  
  <pre><code>tmp &lt;- system("python -c 'C:/coa/script_tool/pathgetter.py'", intern=TRUE)
  </code></pre>
  
  <p>However, the variable that is stored in R is character(0). I would like the tmp variable in R to contain the path that is printed in the Python script. Does anyone have any suggestions for changes?</p>