本文整理汇总了Java中org.rosuda.JRI.RConsoleOutputStream类的典型用法代码示例。如果您正苦于以下问题:Java RConsoleOutputStream类的具体用法?Java RConsoleOutputStream怎么用?Java RConsoleOutputStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RConsoleOutputStream类属于org.rosuda.JRI包,在下文中一共展示了RConsoleOutputStream类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.rosuda.JRI.RConsoleOutputStream; //导入依赖的package包/类
public static void main(String[] args) {
System.out.println("Press <Enter> to continue (time to attach the debugger if necessary)");
try { System.in.read(); } catch(Exception e) {};
System.out.println("Creating Rengine (with arguments)");
Rengine re=new Rengine(args, true, new TextConsole2());
System.out.println("Rengine created, waiting for R");
if (!re.waitForR()) {
System.out.println("Cannot load R");
return;
}
System.out.println("re-routing stdout/err into R console");
System.setOut(new PrintStream(new RConsoleOutputStream(re, 0)));
System.setErr(new PrintStream(new RConsoleOutputStream(re, 1)));
System.out.println("Letting go; use main loop from now on");
}
示例2: main
import org.rosuda.JRI.RConsoleOutputStream; //导入依赖的package包/类
public static void main(String[] args) {
args = new String[1];
args[0] = "--vanilla";
System.out.println("Press <Enter> to continue (time to attach the debugger if necessary)");
try { System.in.read(); } catch(Exception e) {};
System.out.println("Creating Rengine (with arguments)");
Rengine re=new Rengine(args, true, new TextConsole2());
System.out.println("Rengine created, waiting for R");
if (!re.waitForR()) {
System.out.println("Cannot load R");
return;
}
System.out.println("re-routing stdout/err into R console");
System.setOut(new PrintStream(new RConsoleOutputStream(re, 0)));
System.setErr(new PrintStream(new RConsoleOutputStream(re, 1)));
System.out.println("Letting go; use main loop from now on");
}