一、 Java & R 为什么需要产生关系呢?
R是统计计算的强大工具,而JAVA是做应用系统的主流语言,两者天然具有整合的需要。关于整合,一方面,R中可以创建JAVA对象调用JAVA方法,另一方面,JAVA中可以转换R的数据类型调用R的函数,互相取长补短。
二、 Java & R 发生了什么关系呢?
2.1 JRI——http://www.rforge.net/JRI/>>>以Java为主的同学们可以考虑JRI:JRI作为Java调用R的接口,能够通过JAVA API动态的加载R各种的算法类库。
JRI is a Java/R Interface, which allows to run R inside Java applications as a single thread. Basically it loads R dynamic library into Java and provides a Java API to R functionality. It supports both simple calls to R functions and a full running REPL.
2.2 Rcaller——http://code.google.com/p/rcaller/ >>>以Java为主的同学们也可以考虑Rcaller,并且其还提供了一个开发的界面。RCaller 2.0能够实现将R List对象转化成为Java或者XML,现在正在开发将Java Aarray移植到R对应的数据类型,目标是通过XML作为R和Java联系的纽带。
RCaller is used by several users that interested in both R and Java. RCaller 2.0 uses the package Runiversal which has two functions for converting R list objects to Java or XML. The new logic underlying the RCaller is to translate java arrays to R, send them and the commands to R interpreter and handle the results as XML documents. XML documents then parsed using Java’s standard XML DOM document API’s. Finally, user can handle the results from Java.
2.3 rJava——http://www.rforge.net/rJava/ >>>以R为主的同学们可以考虑rJava,通过R来控制Java。rJava通过JNI(Java Native Interface)链接Java和R,并实现在R创建Java对象,调用Java方法,以及获取相应的Java字段等等功能。
rJava is a simple R-to-Java interface. rJava provides a low-level bridge between R and Java (via JNI). It allows to create objects, call methods and access fields of Java objects from R.
2.4 JGR:java GUI for R——http://www.rforge.net/JGR/ >>>以Java为主的同学们,作图可以考虑JGR。这个还不错!
JGR (speak ‘Jaguar’) is a universal and unified Graphical User Interface for R (it actually abbreviates Java Gui for R).
备注:关于在win7系统下,Eclipse设置显示字体Courier New:
1、设置电脑字体属性:控制面板->字体,找到Courier New,单击右键,选择显示操作。
2、配置Eclipe显示字体:Preferences-〉general-〉Appearance->Colors and Fonts, 单击Edit,选择Courier New,并确定相应的字体大小。