本文整理匯總了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");
}