title: How to print on RDotNet console
body: <p>ar envPath = Environment.GetEnvironmentVariable(&quot;PATH&quot;);
  var rBinPath = @&quot;C:\R-4.0.2\bin\i386&quot;;
  Environment.SetEnvironmentVariable(&quot;PATH&quot;, envPath + Path.PathSeparator + rBinPath);</p>
  <pre><code>        REngine r = REngine.GetInstance();
  
          r.Initialize();
  
  
       
          r.Evaluate(&quot;library('ggplot2')&quot;);
          r.Evaluate(&quot;set.seed(0)&quot;);
          r.Evaluate(&quot;n_samples &lt;- 30&quot;);
          r.Evaluate(&quot;x &lt;- runif(n_samples)&quot;);
          r.Evaluate(&quot;x &lt;- x[order(x)]&quot;);
          r.Evaluate(&quot;y &lt;- cos(1.5 * pi * x) + rnorm(n_samples) * 0.1&quot;);
          r.Evaluate(&quot;df &lt;- data.frame(x, y)&quot;);
          r.Evaluate(&quot;model1 &lt;- lm(y ~ x, data=df)&quot;);
          r.Evaluate(&quot;print(summary(model1))&quot;);
         
  </code></pre>
  <hr />
  <p>result:
  <a href="https://i.stack.imgur.com/QiaBp.png" rel="nofollow noreferrer">enter image description here</a></p>