- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 RCaller 从 Java 调用 R。请参阅以下 Java 代码:
RCaller caller = new RCaller();
RCode code = new RCode();
caller.setRscriptExecutable("/usr/bin/Rscript");
caller.cleanRCode();
String x = "is.installed <- function(mypkg){ \n" +
"is.element(mypkg, installed.packages()[,1])\n"+
"}\n" +
"is.installed(\"bbmle\")";
StringBuffer s = new StringBuffer(x);
code.setCode(s);
System.out.println(x);
caller.setRCode(code);
caller.redirectROutputToConsole();
caller.runOnly();
这是 Java 输出。请注意 Rcaller 如何决定在 R 代码末尾添加一个 q
(请参阅下面输出中的倒数第二行)。这是怎么回事?请注意,当我打印输出时,那里没有 q
。
is.installed <- function(mypkg){
is.element(mypkg, installed.packages()[,1])
}
is.installed("bbmle")
Error:Error: unexpected symbol in "is.installed("bbmle")q"
Error:Execution halted
最佳答案
RCaller 发送
q("yes")
命令R(在RunOnly()方法中),但是当你忘记在代码末尾放回车符时,并不是所有的R代码都可以发送到R(只有q部分被发送)发送)。使用
is.installed(\"bbmle\")\n
相反。
关于java - Rcaller 将 q 字符添加到 StringBuffer 的末尾,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21515155/
我正在尝试使用 R 调用程序将回归 R 代码集成到我的 j2ee 项目中。我的数据源来自mysql数据库。所以我使用 RMYSQL 作为包。我的代码在 java 项目下工作正常,但是当我将其移动到支持
我使用 RCaller 来从 java 程序调用 R我尝试使用 RCaller 调用 R 的电脑无法访问互联网;现在我有这样的情况:我从 Java 编写 R 代码,然后通过使用 RCode 我将此代码
我正在尝试在 Windows 8、JRE 7、RCaller 2.4 和 R-3.0.2 上运行的 Eclipse 中的示例。我也试过R-3.1.1。但是当生成图时,它显示为空,并且没有显示任何异常或
我正在使用 RCaller 对我的 Java 应用程序 中的数据帧执行一些分析。更具体地说,我想使用 R 的 CEM 库运行 Coarsened Exact Matching。 就CEM而言,如果发现
我正在使用 RCaller 以在 Java 中执行 R 文件。 基本上,它看起来像这样: RCaller caller = new RCaller(); RCode code = new RCode(
我在 Java 中使用 RCaller 来执行外部 R 程序。 问题是,我不知道矩阵的确切大小,但 .getAsDoubleMatrix() 方法想要知道该大小。 double[][] matrix
setRscriptExecutable() 应该指向什么文件路径? 我用 Google 搜索过,但没有找到与我需要的相关的内容。 最佳答案 在 Windows 上 C:\\Program Files
所以我正在尝试使用 RCaller 执行以下操作(在伪代码中): x=simarray(..) // in java 'send x to R' run y = rlogcon(40000, sort
我正在尝试使用 RCaller 从 java 连接 R,这是我的代码 RCaller caller = new RCaller(); RCode code = new RCode(); caller.
我尝试从 RCaller 开始,但一开始就失败了。 当我尝试运行任何示例时,该行 RCaller caller = RCaller.create(); 给出以下异常: Exception in thr
我正在制作一个 Java GUI 来配合我同事的定制 R 包 IntramiRExploreR,其中包括一个通过 igraph 和 IntramiRExploreR 的可视化函数创建交互式图形的函数,
我正在尝试从java执行R文件,这是我尝试过的代码。 RCaller caller = new RCaller(); RCode code = new RCode(); caller.setRscr
我正在尝试通过使用 R 调用程序在 Java 中使用 R 实现集群。我正在尝试运行用于集群验证的示例代码,但我遇到了大多数用户面临的常见错误:文件过早结束 package test; import r
我正在使用 RCaller 2.1.1-SNAPSHOT 编写程序。问题是当我使用外部库中的代码时,它说 Routput 文件为空。这是我的代码: Random random = new Rand
我的项目有一些预构建的 R 文件,我需要从 Java 层 调用它们。 我想不出一种方法来为 RCaller 提供 RScript 文件路径。 需要帮助从 RCaller Java 调用 RScript
当我想通过 RCaller 运行一些代码时,Java 抛出以下异常: Exception in thread "JavaFX Application Thread" com.github.rcalle
我目前正在使用 rcaller 基于 mysql 数据库进行分析回归。现在我一直在研究如何将数据库表从 java 转移到 R。这是我试过的。 Class.forName("com.mysql.jdbc
我正在使用 RCaller 从 Java 调用 R。请参阅以下 Java 代码: RCaller caller = new RCaller(); RCode code = new RCode(); c
Rcaller 2.0 生成的绘图呈现空输出并且生成的文件 (png) 也是空的?发布我使用过的代码的链接 http://stdioe.blogspot.in/2011/07/rcaller-20-c
我尝试使用 RCaller 2.0 从 Java 中调用 R 函数,并在几次尝试后设法让它工作。集成非常简单,但 RCaller 在运行时有点慢。我担心 RCaller 2.0 不适合我的应用程序,因
我是一名优秀的程序员,十分优秀!