Package org.rosuda.REngine

Examples of org.rosuda.REngine.REXP.asString()


        con.eval("do.call(svg,c(list('" + file + "'), beaker::saved_svg_options))");
        tryCode = "beaker_eval_=withVisible(try({" + code + "\n},silent=TRUE))";
      }
      REXP result = con.eval(tryCode);
      if (init) {
        obj.finished(result.asString());
        return obj;
      }

      if (false) {
        if (null != result)
View Full Code Here


  private static boolean isError(REXP result, SimpleEvaluationObject obj) {
    try {
      REXP value = result.asList().at(0);
      if (value.inherits("try-error")) {
        String prefix = "Error in try({ : ";
        String rs = value.asString();
        if (rs.substring(0, prefix.length()).equals(prefix)) {
          rs = rs.substring(prefix.length());
        }
        obj.error(rs);
        return true;
View Full Code Here

    try
    {
      if(!safe && asString)
      {
        ret = rConnection.eval("paste(capture.output(print(" + command + ")),collapse='\\n')");
        Logs.log(ret.asString(), R.class);
      }
      else if(!safe)
      {
        ret = rConnection.parseAndEval("try(" + command + ",silent=TRUE)");
        if(ret.inherits("try-error"))
View Full Code Here

      else if(!safe)
      {
        ret = rConnection.parseAndEval("try(" + command + ",silent=TRUE)");
        if(ret.inherits("try-error"))
        {
          Logs.log(ret.asString(), Logs.ERROR, R.class);
        }
        else
        {}
      }
      else //safe
View Full Code Here

          REXP rhive_data = getConnection().eval(
              "Sys.getenv('RHIVE_DATA')");
          String srhive_data = null;

          if (rhive_data != null) {
            srhive_data = rhive_data.asString();
          }

          if (srhive_data == null || srhive_data.length() == 0) {
            getConnection().eval(
                "load(file=paste('/tmp','/" + export_name
View Full Code Here

    if (rdata != null) {
      try {
        if (rdata instanceof REXPInteger) {
          return new IntWritable(rdata.asInteger());
        } else if (rdata instanceof REXPString) {
          return new Text(rdata.asString());
        } else if (rdata instanceof REXPDouble) {
          return new DoubleWritable(rdata.asDouble());
        } else {
          throw new HiveException(
              "only support integer, string and double");
View Full Code Here

        REXP rhive_data = getConnection().eval(
            "Sys.getenv('RHIVE_DATA')");
        String srhive_data = null;

        if (rhive_data != null) {
          srhive_data = rhive_data.asString();
        }

        if (srhive_data == null || srhive_data == ""
            || srhive_data.length() == 0) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.