Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

New Post: Raw output from R

$
0
0
Hello,

I am currently trying to return the output from R exactly the way R would show in its console.

I am open to any method that works.

I tried using GenericVectors and iterating through it but the output was not organized very well for some of the outputs.

I would prefer to use something like sink() but the text file is empty.
I currently changed the code to something very simple to help ensure there is no error in the R code.

I tried to run it directly from C#:
            ThisAddIn.engine.Evaluate("sink('c:/temp/out.txt')");
            ThisAddIn.engine.Evaluate("dt<-c(3,3,4,4,5,5,6,6)");
            ThisAddIn.engine.Evaluate("h<-hist(dt)");
            ThisAddIn.engine.Evaluate("h");
            ThisAddIn.engine.Evaluate("sink()");
And I have tried to put the code in a file
            ThisAddIn.engine.Evaluate(@"source('C:/Users/default/Desktop/test.r')");
but the results are the same.
I get the Histogram graph which displays fine.
And the text file gets created and the date modified gets updated.
but the text file itself is empty inside.

Any suggestions would be very helpful.

Thanks!

Viewing all articles
Browse latest Browse all 1634

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>