【问题标题】:R JRI java integrationR JRI java集成
【发布时间】:2013-11-20 21:03:07
【问题描述】:

我需要这方面的帮助:我安装了 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.

【问题讨论】:

    标签: java r rjava jri


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-19
      • 2013-10-06
      • 2014-06-27
      • 2015-05-12
      • 2011-11-19
      • 2018-01-17
      • 2015-11-18
      • 1970-01-01
      相关资源
      最近更新 更多