REngine rengine = REngine.CreateInstance("RDotNet",new [] {"-q")在第二次调用时进一步停止执行 [英] REngine rengine = REngine.CreateInstance("RDotNet", new[] { "-q" } stops the execution further when called second time

查看:77
本文介绍了REngine rengine = REngine.CreateInstance("RDotNet",new [] {"-q")在第二次调用时进一步停止执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用R.NET和ASP.NET MVC3绘制预测图.第一次,它创建一个RENgine的实例.通过

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();

    }
}

推荐答案

我只是在重新发布关于我在哪里找到问题的评论,但众所周知,您对评论的赞誉不大.

I'm just reposting a comment that I had made about where to find the issue, but as everyone knows you don't get points for upvotes on comments.

同时在R.NET上并行搜索此MSDN .我知道您不会一次创建两个,但这看起来会导致完全相同的问题.

Check out this MSDN on R.NET in parallel. I know you are not creating two at once, but it looks like this leads to exactly your same issue.

这篇关于REngine rengine = REngine.CreateInstance("RDotNet",new [] {"-q")在第二次调用时进一步停止执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆