I need to plot a graph from R to file using c# on x86 machine (Visual Studio 2010). I tried to follow example from
but file wasn't created.
Here is my code:
var envPath = System.Environment.GetEnvironmentVariable("PATH");
var rBinPath = @"C:\Temp\test\R-lib";
System.Environment.SetEnvironmentVariable("PATH", envPath + Path.PathSeparator + rBinPath);
REngine engine = REngine.CreateInstance("RDotNet");
But everything is fine when I execute the same command in R console
Could you please help me to find where is my error?
Mar 9, 2013 at 11:09 PM
Works for me. I think you overlook something I noticed with R when writing graphics to files: the information is not written until you either call plot to write to another file (with Cairo drivers writting to a succession of files) or you close the device
plot(rnorm(200)) # only creates an empty file on disk
dev.off() # This is the call that causes the information to be written to the file.