I am plotting the forecast graph by using R.NET and using ASP.NET MVC3. At first time, it creates an instance of RENgine. by
REngine rengine = REngine.CreateInstance("RDotNet", new[] { "-q" })
and plots the graph as required. But when I call this same method second time by choosing another graph to be plotted, it stops to move further after this,. Please someone help me to figure out where I am going wrong. The code I have used is
using (REngine rengine = REngine.CreateInstance("RDotNet", new[] { "-q" }))
{
rengine.EagerEvaluate("YrTimeSeries<-c(123,234,255,456)");
rengine.EagerEvaluate("tsValue<-ts(YrTimeSeries,frequency=1,"
+ dt_StartYr.Rows[0][0].ToString() + ")");
rengine.EagerEvaluate("library(Cairo);");
rengine.EagerEvaluate("library(forecast)");
rengine.EagerEvaluate(@"CairoPNG('C:\\Documents and Settings\\a\\im.png);
rengine.EagerEvaluate("plot(forecast(tsValue,h=5),main='Immunization')");
rengine.EagerEvaluate("graphics.off();");
rengine.Close();
rengine.Dispose();
}
}