R与Java的完美结合:JRI/rJava实战指南

📅 2026/7/9 7:13:27
R与Java的完美结合:JRI/rJava实战指南
检查出那个JRI/rJava, 它是一种Java和R的相关事物。在你完成那个之后,查看那个。REF rPath.R;.().exec(\\R\\bin\\ );.().exec( .R);Process child Runtime.getRuntime().exec(command, environments, dataDir); int code child.waitFor(); switch (code) { case 0: //normal termination, everything is fine break; case 1: //Read the error stream then String message IOUtils.toString(child.getErrorStream()); throw new RExecutionException(message); } null;shell null;try {shell .().exec(new包含, “/usr/bin/”, 以及, “/media/subin/works////.R”。 new (new (shell.()));line;while ((line .()) ! null){ .out.(line); } }catch ( e){ e.(); }Context context Context.newBuilder(R).allowAllAccess(true).build(); int result context.eval(R, sum).execute(new int[] {3,4,5}).asInt(); context.eval(R, print(you can eval any R code here););