[nbdiscuss_ja] rJavaについて

  • From: "I.Andoh" < >
  • To: < >
  • Subject: [nbdiscuss_ja] rJavaについて
  • Date: Wed, 1 Feb 2012 09:00:11 +0900
  • Importance: Normal

片貝さんのご指導でrJavaが動くようになりました。
 
1 OSはWindows7,XP NBは7.1 rJavaは2.14.1
 
2 環境変数
Path
c:\R\R-2.14.1\bin\i386\;c:\R\R-2.14.1\library\rJava\jri\i386\;
以下はR javaのバージョンで異なる。
c:\Program Files\java\jre7\bin\client;
c:\Program Files\java\jdk1.7.0_02\jre\bin\client;
c:\Program Files\java\jdk1.7.0_02\bin
 
CLASSPATH=c:\R\R-2.14.1\library\rJava\jri
 
3 ツール・ライブラリーでnb native ribrary にJRI追加
 
4 projectにライブラリー追加
 
5 VMオプションに-Djava.library.path=”C:\R\R-2.14.i\library\rJava\jri”を設定
 
6 実行 エラーの場合nbを再立ち上げ。
 
テスト・プログラム
 
package rtest3;
 
/**
*
* @author owner
*/
import org.rosuda.JRI.REXP;
import org.rosuda.JRI.Rengine;
 
public class rtest3 {
 
    /**
     * @param args the command line arguments
     */
   public static void main(String[] args)
    {
        Rengine engine = new Rengine(new String[]{"--no-save"}, false,
null);
        engine.assign("a", new int[]{36});
        REXP result = engine.eval("sqrt(a)");
        System.out.println(result.asDouble());
        engine.end();
    }
}
 
手順をまとめました        
                     安東
 


[nbdiscuss_ja] rJavaについて

I.Andoh 02/01/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close