當前位置: 首頁>>代碼示例>>Java>>正文


Java RConsoleOutputStream類代碼示例

本文整理匯總了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");
  }
 
開發者ID:starqiu,項目名稱:RDMP1,代碼行數:17,代碼來源:rtest2.java

示例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");
  }
 
開發者ID:fauconnier,項目名稱:LaToe,代碼行數:21,代碼來源:rtest2.java


注:本文中的org.rosuda.JRI.RConsoleOutputStream類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。