首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >R JRI java集成

R JRI java集成
EN

Stack Overflow用户
提问于 2013-11-21 05:03:07
回答 1查看 797关注 0票数 0

在这一点上我需要帮助:我安装了JRI,一切都正常。我可以开始使用rJava提供的示例,但当我尝试自己的代码时,这简直是一场灾难。代码如下:

代码语言:javascript
复制
re.eval(".libPaths('C:/Users/the_one/Documents/R/win-library/3.0');");
re.eval("library(forecast);");
re.eval("data<-scan('C:\\Users\\the_one\\Desktop\\RBRTEd1.csv');");
re.eval("plot(data, col=\"blue\", type=\'l\', main=\"Crude oil price 2009  until 2013\");");
re.eval("datats<-ts.(data,frequency=365;");
re.eval("arima<-auto.arima(datats,h5);");
re.eval("test1<-auto.arima(datats,trace=TRUE);");
REXP trace = re.eval("test1;");
System.out.println(trace);
re.eval("dataforcast<-forecast(arima);");
REXP fs = re.eval("summary(dataforecast);");


double[] forecast = fs.asDoubleArray();

for(int i=0; i<forecast.length; i++)
    System.out.println(forecast[i]);

re.end();

我得到的是以下错误:

代码语言:javascript
复制
A fatal error has been detected by the Java Runtime Environment:

 Internal Error (os_windows_x86.cpp:143), pid=3956, tid=8456
 guarantee(result == EXCEPTION_CONTINUE_EXECUTION) failed: Unexpected result from topLevelExceptionFilter

 JRE version: Java(TM) SE Runtime Environment (7.0_45-b18) (build 1.7.0_45-b18)
 Java VM: Java HotSpot(TM) 64-Bit Server VM (24.45-b08 mixed mode windows-amd64 compressed oops)
 Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

 An error report file with more information is saved as:
 C:\Users\the_one\Documents\R\win-library\3.0\hs_err_pid3956.log

 If you would like to submit a bug report, please visit:
  http://bugreport.sun.com/bugreport/crash.jsp
 The crash happened outside the Java Virtual Machine in native code.
 See problematic frame for where to report the bug.
EN

回答 1

Stack Overflow用户

发布于 2013-11-30 01:53:29

错误已解决,是这里的这一部分:

re.eval("data<-scan('C:\\Users\\the_one\\Desktop\\RBRTEd1.csv');");

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20106961

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档