Passing args[] to R with spaces
<p>I have php exec function and i get error when args contains whitespaces  :</p>

<pre><code>$cluster = "bla  bla";
$region  = "east  region";


 exec("\"F:\\PROB\\R\\R-3.3.0\\bin\\Rscript.exe\" 
       F:\\web\\Component\\script.R $cluster $region");
</code></pre>

<p>in my R script:</p>

<pre><code>args &lt;- commandArgs(TRUE) 
cluster &lt;- args[1]
region &lt;- args[2]
...
</code></pre>

<p>i try use quote <code>"$cluster"</code> and <code>'$cluster'</code> inside it, but still got error (R script won't run). </p>

<p>What can I change in the exec function to see the string being passed in via args[] as the argument?</p>