我需要这方面的帮助:我安装了 JRI,一切正常。我可以启动 rJava 提供的示例,但是当我尝试自己的代码时,这简直是一场灾难。这是代码:
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();
我得到的是以下错误:
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.