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


Java RConnection.voidEval方法代码示例

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


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

示例1: removeFile

import org.rosuda.REngine.Rserve.RConnection; //导入方法依赖的package包/类
/**
 * Remove a file on the RServer.
 * @param filename File to remove
 */
public void removeFile(final String filename) throws REngineException {

  // Test if the file exists
  final RConnection c = getRConnection();

  try {

    REXP exists = c.eval("file.exists(\"" + filename + "\")");
    if (exists.asInteger() == 1) {
      c.voidEval("file.remove(\"" + filename + "\")");
    }

  } catch (RserveException | REXPMismatchException e) {
    throw new REngineException(c, "RServe exception: " + e);
  }
}
 
开发者ID:GenomicParisCentre,项目名称:eoulsan,代码行数:21,代码来源:RSConnection.java

示例2: executeRCode

import org.rosuda.REngine.Rserve.RConnection; //导入方法依赖的package包/类
/**
 * Execute a R code.
 * @param source code to execute
 * @throws REngineException if an error while executing the code
 */
public void executeRCode(final String source) throws REngineException {

  if (source == null) {
    return;
  }

  final RConnection c = getRConnection();

  try {

    // Execute the source
    c.voidEval("source(\"" + source + "\")");

  } catch (RserveException e) {
    throw new REngineException(c, "RServe exception: " + e);
  }
}
 
开发者ID:GenomicParisCentre,项目名称:eoulsan,代码行数:23,代码来源:RSConnection.java

示例3: setCommandArgs

import org.rosuda.REngine.Rserve.RConnection; //导入方法依赖的package包/类
/**
 * Override the commandArg() R function.
 * @param arguments the arguments
 * @throws REngineException if an error occurs while executing R code
 */
public void setCommandArgs(final List<String> arguments)
    throws REngineException {

  if (arguments == null) {
    throw new NullPointerException("arguments argument cannot be null");
  }

  final StringBuilder sb = new StringBuilder();
  sb.append("f <- function(trailingOnly = FALSE) { c(");

  boolean first = true;
  for (String arg : arguments) {

    if (first) {
      first = false;
    } else {
      sb.append(",");
    }
    sb.append('\'');
    sb.append(arg);
    sb.append('\'');
  }

  sb.append(") }");

  final RConnection c = getRConnection();

  try {

    // Execute the source
    c.voidEval(sb.toString());

  } catch (RserveException e) {
    throw new REngineException(c, "RServe exception: " + e);
  }
}
 
开发者ID:GenomicParisCentre,项目名称:eoulsan,代码行数:42,代码来源:RSConnection.java

示例4: executeRnwCode

import org.rosuda.REngine.Rserve.RConnection; //导入方法依赖的package包/类
/**
 * Execute a R Sweave code.
 * @param source code to execute
 * @param latexOutput output latex filename
 * @throws REngineException if an error while executing the code
 */
public void executeRnwCode(final String source, final String latexOutput)
    throws REngineException {

  if (source == null) {
    return;
  }

  final RConnection c = getRConnection();

  final StringBuilder sb = new StringBuilder();
  sb.append("Sweave(\"");
  sb.append(source);
  sb.append('\"');

  if (latexOutput != null) {
    sb.append(", output=\"");
    sb.append(latexOutput);
    sb.append('\"');
  }
  sb.append(')');

  try {
    c.voidEval(sb.toString());
  } catch (RserveException e) {
    throw new REngineException(c, "Rserve exception: " + e);
  }
}
 
开发者ID:GenomicParisCentre,项目名称:eoulsan,代码行数:34,代码来源:RSConnection.java


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