title: call r script from c++ gives cannot convert Rcpp::CharacterVector to const char*
body: <p>Is there a way to call an r script from C++ ?</p>
  
  <p>I have an rscript , for example:</p>
  
  <p>myScript.R:</p>
  
  <pre><code>runif(100)
  </code></pre>
  
  <p>I want to execute this script from C++ and pass the result.</p>
  
  <p>I tried:</p>
  
  <pre><code>#include &lt;Rcpp.h&gt;
  #include &lt;iostream&gt;
  using namespace Rcpp;
  
  // [[Rcpp::export]]
  NumericVector loadFile(CharacterVector inFile){
      NumericVector one = system(inFile);
      return one;
  }
  </code></pre>
  
  <p><code>inFile : "C:/Program Files/R/R-3.4.2/bin/x64/Rscript C:/Rscripts/myScript.R"</code></p>
  
  <p>but it gives me :</p>
  
  <p><code>cannot convert Rcpp::CharacterVector (aka Rcpp::Vector&lt;16&gt;} to const char* for argument 1 to int system(const char*)</code></p>