第一个rJava案例

 1     public static void main(String[] args) {
 2         // TODO 自动生成的方法存根
 3         
 4         Rengine re = new Rengine(null,false,null);
 5         
 6         if(!Rengine.versionCheck())
 7         {
 8             System.out.println("R version check failed!");
 9             return;
10         }
11         
12         if(!re.waitForR())
13         {
14             return ;
15         }
16         
17         REXP result = re.eval("x<-c(1:10)");
18         
19         System.out.println(result);
20         
21 
22     }

输出:

[INT* (1, 2, 3, 4, 5, 6, 7, 8, 9, 10)]

猜你喜欢

转载自www.cnblogs.com/qianheng/p/9901147.html