当前位置: 首页>>代码示例>>Java>>正文


Java Rengine.waitForR方法代码示例

本文整理汇总了Java中org.rosuda.JRI.Rengine.waitForR方法的典型用法代码示例。如果您正苦于以下问题:Java Rengine.waitForR方法的具体用法?Java Rengine.waitForR怎么用?Java Rengine.waitForR使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.rosuda.JRI.Rengine的用法示例。


在下文中一共展示了Rengine.waitForR方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public static void main(String[] args) {
	
	System.out.println("Creating Rengine (with arguments)");
	// If not started with --vanilla, funny things may happen in this R
	// shell.
	String[] Rargs = { "--vanilla" };
	Rengine re = new Rengine(Rargs, false, null);
	System.out.println("Rengine created, waiting for R");
	// the engine creates R is a new thread, so we should wait until it's
	// ready
	if (!re.waitForR()) {
		System.out.println("Cannot load R");
		return;
	}		
	
	ImportingObjs.Start(re);
	ExportingObjs.Start(re);
	
	re.end();
}
 
开发者ID:osimloeff,项目名称:Integrating-PI-System-with-R-White-Paper,代码行数:21,代码来源:StartJRI.java

示例2: InicializeRNet

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
private void InicializeRNet() {

		System.out.println("Creating Rengine (with arguments)");
		// If not started with --vanilla, funny things may happen in this R
		// shell.
		String[] Rargs = { "--vanilla" };
		engine = new Rengine(Rargs, false, null);
		// System.out.println("Rengine created, waiting for R");
		// the engine creates R is a new thread, so we should wait until it's
		// ready
		if (!engine.waitForR()) {
			System.out.println("Cannot load R");
			return;
		}
		String rfilepath = "C:\\\\Program Files\\\\R\\\\R-3.3.1\\\\library\\\\Functions.R";
		engine.eval("source(\"" + rfilepath + "\")");

	}
 
开发者ID:osimloeff,项目名称:Integrating-PI-System-with-R-White-Paper,代码行数:19,代码来源:Application.java

示例3: main

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public static void main(String[] args) {
	// just making sure we have the right version of everything
	if (!Rengine.versionCheck()) {
		System.err.println("** Version mismatch - Java files don't match library version.");
		System.exit(1);
	}
	System.out.println("Creating Rengine (with arguments)");

	Rengine re=new Rengine(args, false, new TextConsole());
	System.out.println("Rengine created, waiting for R");
	// the engine creates R is a new thread, so we should wait until it's ready
	if (!re.waitForR()) {
		System.out.println("Cannot load R");
		return;
	}

	
	selectOneEnabled(re);
	selectOneDisabled(re);
	selectMostEnabledDisabled(re);
	
	re.end();
	System.out.println("end");
}
 
开发者ID:axel-halin,项目名称:Thesis-JHipster,代码行数:25,代码来源:RAnalysis.java

示例4: main

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public static void main(String[] args) {

		// just making sure we have the right version of everything
		if (!Rengine.versionCheck()) {
			System.err.println("** Version mismatch - Java files don't match library version.");
			System.exit(1);
		}
		System.out.println("Creating Rengine (with arguments)");

		re= new Rengine(args, false, new TextConsole());
		System.out.println("Rengine created, waiting for R");
		// the engine creates R is a new thread, so we should wait until it's ready
		if (!re.waitForR()) {
			System.out.println("Cannot load R");
			System.exit(1);
		}
		
		RAnalysis.readCSV(re,"jhipsterFeatures.csv","data");
		System.out.println("File read");
		
		//oneEnabled(re);
		//oneDisabled(re);
		mostEnabledDisabled(re);
		
		re.end();
		System.out.println("done");
	}
 
开发者ID:axel-halin,项目名称:Thesis-JHipster,代码行数:28,代码来源:Sampling.java

示例5: init

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public void init() {
	// Making sure we have the right version of everything
	if (!Rengine.versionCheck()) {
	    System.err.println("** Version mismatch - Java files don't match library version.");
	    System.exit(1);
	}
	
	String[] args = {"--vanilla"};
	re = new Rengine(args, false, new TextConsole());
	
	// the engine creates R is a new thread, so we should wait until it's ready
       if (!re.waitForR()) {
           System.out.println("Cannot load R");
           return;
       }
	
}
 
开发者ID:goyalr41,项目名称:UnusualGitCommit,代码行数:18,代码来源:DataStatistics.java

示例6: setUpR

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
@BeforeClass
public static void setUpR() {
	// just making sure we have the right version of everything
	if (!Rengine.versionCheck()) {
		System.err.println("** Version mismatch - Java files don't match library version.");
		fail(String.format("Invalid versions. Rengine must have the same version of native library. Rengine version: %d. RNI library version: %d", Rengine.getVersion(), Rengine.rniGetVersion()));
	}
	
	// Enables debug traces
	Rengine.DEBUG = 1;
	
	System.out.println("Creating Rengine (with arguments)");
	// 1) we pass the arguments from the command line
	// 2) we won't use the main loop at first, we'll start it later
	// (that's the "false" as second argument)
	// 3) no callback class will be used
	engine = new Rengine(new String[] { "--no-save" }, false, null);
	System.out.println("Rengine created, waiting for R");
	// the engine creates R is a new thread, so we should wait until it's
	// ready
	if (!engine.waitForR()) {
		fail("Cannot load R");
	}
}
 
开发者ID:jfcorugedo,项目名称:RJavaServer,代码行数:25,代码来源:SimpleArithmeticCalculationsIT.java

示例7: callRJava

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public void callRJava() {
      Rengine re = new Rengine(new String[] { "--vanilla" }, false, new rtest3());
      if (!re.waitForR()) {
          System.out.println("Cannot load R");
          return;
      }
      
      
      //String path = re.jriChooseFile(0);
      String cmd = "source('/home/starqiu/workspace/RDMP1/src/main/java/ustc/sse/r/tbmr.R',echo=TRUE)";
      //String cmd = "source('/home/starqiu/workspace/RDMP1/src/main/java/ustc/sse/r/WordCount.R',echo=TRUE)";
      String rv = re.eval(cmd).asString();
      /*System.out.println(rv);
      String cmd2="area(10)";
      REXP res = re.eval(cmd2);
      System.out.println(res.asDouble());
      res = re.eval("a");
      for (int b : res.asIntArray()) {
	System.out.println(b);
}*/
      re.end();
  }
 
开发者ID:starqiu,项目名称:RDMP1,代码行数:23,代码来源:rtest3.java

示例8: main

import org.rosuda.JRI.Rengine; //导入方法依赖的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

示例9: main

import org.rosuda.JRI.Rengine; //导入方法依赖的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

示例10: Rengine_Service

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public Rengine_Service(){
		String args [] = new String[1];
    	args[0] = "--vanilla";
    	
//        System.out.println("Creating Rengine (with arguments)");
 		// 1) we pass the arguments from the command line
 		// 2) we won't use the main loop at first, we'll start it later
 		//    (that's the "false" as second argument)
 		// 3) the callbacks are implemented by the TextConsole class above
 		re=new Rengine(args, false, new TextConsole());
//        System.out.println("Rengine created, waiting for R");
		// the engine creates R is a new thread, so we should wait until it's ready
        if (!re.waitForR()) {
            System.out.println("Cannot load R");
        }
        
	}
 
开发者ID:fauconnier,项目名称:LaToe,代码行数:18,代码来源:Rengine_Service.java

示例11: createREngine

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
private void createREngine(){
	if (!Rengine.versionCheck()) {
		System.err.println("** Version mismatch - Java files don't match library version.");
		System.exit(1);
	}
	System.out.println("Creating Rengine (with arguments)");
	// 1) we pass the arguments from the command line
	// 2) we won't use the main loop at first, we'll start it later
	//    (that's the "false" as second argument)
	// 3) the callbacks are implemented by the TextConsole class above

	String[] Rargs = {"--no-save"};

	re=new Rengine(Rargs, false, new TextConsole());

	engineState = EngineState.RUNNING;

	System.out.println("Rengine created, waiting for R");
	// the engine creates R is a new thread, so we should wait until it's ready
	if (!re.waitForR()) {
		System.out.println("Cannot load R");
		engineState = EngineState.STOPPED;
		return;		
	}		
	initREngine();
}
 
开发者ID:LSIR,项目名称:gsn,代码行数:27,代码来源:REngineManager.java

示例12: InicializeRNet

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
private void InicializeRNet()
  {
  
System.out.println("Creating Rengine (with arguments)");
// If not started with --vanilla, funny things may happen in this R
// shell.
String[] Rargs = { "--vanilla" };
engine = new Rengine(Rargs, false, null);
// System.out.println("Rengine created, waiting for R");
// the engine creates R is a new thread, so we should wait until it's
// ready
if (!engine.waitForR()) {
	System.out.println("Cannot load R");
	return;
}
String rfilepath = "C:\\\\Program Files\\\\R\\\\R-2.15.1\\\\library\\\\Functions.R";
engine.eval("source(\"" + rfilepath + "\")");

  }
 
开发者ID:osimloeff,项目名称:Integrating-PI-System-with-R-White-Paper,代码行数:20,代码来源:Application.java

示例13: main

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public static void main(String[] args) {
    	System.out.println(System.getenv("R_HOME"));
    	System.out.println(System.getProperty("java.library.path"));
    	
    	args = new String[1];
    	args[0] = "--vanilla";
    	
//        System.out.println("Creating Rengine (with arguments)");
 		// 1) we pass the arguments from the command line
 		// 2) we won't use the main loop at first, we'll start it later
 		//    (that's the "false" as second argument)
 		// 3) the callbacks are implemented by the TextConsole class above
 		Rengine re=new Rengine(args, false, new TextConsole());
//        System.out.println("Rengine created, waiting for R");
		// the engine creates R is a new thread, so we should wait until it's ready
        if (!re.waitForR()) {
            System.out.println("Cannot load R");
            return;
        }
        
        
        try {
        	REXP x;
        	System.out.println(x=re.eval("library('maximumentropy')"));
        	System.out.println(re.eval("model <- maximumentropy(Species ~., data=iris,addslack=T)"));
        	System.out.println(re.eval("save(model,file='mode.RData')"));
        	System.out.println(x=re.eval("predict(model,subset(iris,select=-Species))"));
        	
        	
        	
        	
        	
        } catch (Exception e) {
			System.out.println("EX:"+e);
			e.printStackTrace();
		}
         
    }
 
开发者ID:fauconnier,项目名称:LaToe,代码行数:39,代码来源:MaxEnt_R.java

示例14: main

import org.rosuda.JRI.Rengine; //导入方法依赖的package包/类
public static void main(String[] args) {
	// just making sure we have the right version of everything
	if (!Rengine.versionCheck()) {
		System.err.println("** Version mismatch - Java files don't match library version.");
		System.exit(1);
	}
	System.out.println("Creating Rengine (with arguments)");
	// 1) we pass the arguments from the command line
	// 2) we won't use the main loop at first, we'll start it later
	//    (that's the "false" as second argument)
	// 3) the callbacks are implemented by the TextConsole class above
	Rengine re=new Rengine(args, false, new TextConsole());
	System.out.println("Rengine created, waiting for R");
	// the engine creates R is a new thread, so we should wait until it's ready
	if (!re.waitForR()) {
		System.out.println("Cannot load R");
		return;
	}

	createCircleTypeApp(re);

	createCircleBuildResult(re);
	
	createBoxplotTimeBuildWithoutDockerApp(re);
	
	createBoxplotTimeBuildWithDockerApp(re);
	
	createBoxplotTimeBuildWithoutDockerBuildTool(re);
	
	createBoxplotTimeBuildWithDockerBuildTool(re);
	
	createBoxplotTimeCompile(re);
	
	createBoxplotTimeGeneration(re);

	createBoxplotCoverage(re);
	
	createBoxplotImageDockerApplications(re);
	
	createBoxplotImageDockerDB(re);

	createBalloonPlot(re);
	
	createBalloonPlotBugsFeatures(re);
	
	createPieChartBuildResultByBuildTool(re);
	
	createBoxplotCucumeberDatabase(re);
	
	re.end();
	System.out.println("end");
}
 
开发者ID:axel-halin,项目名称:Thesis-JHipster,代码行数:53,代码来源:rBoxplot.java


注:本文中的org.rosuda.JRI.Rengine.waitForR方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。