Package org.rosuda.JRI

Examples of org.rosuda.JRI.REXP


  }

  protected static REXP eval(String whatToEval, String errMsg)
  {
    callbacks.clearBuffer();
    REXP result = engine.eval(whatToEval);
    if (result == null)
      throw new IllegalArgumentException(errMsg+" : "+callbacks.getBuffer());
    return result;
  }
View Full Code Here


        {
          if (RViewer.getGraph(title) == null)
          {// create new graph
            RViewer.setNewGraphName(title);
            eval("JavaGD(\"aa\")","JavaGD() failed");
            REXP devNum = eval("dev.cur()","failed to do dev.cur");
           
            RViewer.getGraph(title).init(devNum.asInt()-1);
          }
          eval("dev.set("+(RViewer.getGraph(title).getDeviceNumber()+1)+")","failed to do dev.set for "+title);
          for(String cmd:dataToPlot)
            eval(cmd,"failed to run plot "+cmd);
        }
View Full Code Here

   
    //Get model name out of file
    this.engine.eval("modelname<-load('"+ this.modelFile.getFile().getPath());
    String modelName = this.engine.eval("modelname").asString();
   
    REXP rResult = this.engine.eval("predict(" + modelName + "," + rParamaterAssignString);
   
    if(rResult == null || rResult.getType() == REXP.XT_NULL) {
      result.addError("Empty R result, model has an error");
    } else {
      Map<String, Object> tempPredictions = new HashMap<String, Object>();
      this.processRResult(rResult, tempPredictions, "result");
    }
View Full Code Here

        }
        return ret;
    }

    public static String[] evalStrings(String evalstr) {
        REXP x = getRengine().eval(evalstr);

        if (x != null && x.asStringArray() != null) {
            return x.asStringArray()
        }
        return null;
    }
View Full Code Here

        }
        return null;
    }
 
    public static String evalString(String evalstr) {
        REXP x = getRengine().eval(evalstr);

        if (x != null && x.asStringArray() != null) {
            return x.asStringArray()[1]
        }
        return "lala";
    }
View Full Code Here

        }
        return "lala";
    }
 
    public static double[] evalDoubles(String evalstr) {
        REXP x = getRengine().eval(evalstr);

        if (x != null && x.asDoubleArray() != null) {
            return x.asDoubleArray()
        }
        return null;
    }
View Full Code Here

        }
        return null;
    }
 
    public static Double evalDouble(String evalstr) {
        REXP x = getRengine().eval(evalstr);

        if (x != null && x.asDoubleArray() != null) {
            // TODO: try sinnvoll?
            try {
                return x.asDoubleArray()[0]
            } catch (Exception e) {
                return 0.0;
            }
        }
        return 0.0;
View Full Code Here

        }
        return 0.0;
    }
 
    public static int evalInt(String evalstr) {
        REXP x = getRengine().eval(evalstr);

        if (x != null && x.asIntArray() != null) {
            return x.asIntArray()[0];
       
        log.error("Error while evaling" + evalstr);
        return -1;
    }
View Full Code Here

        log.error("Error while evaling" + evalstr);
        return -1;
    }
 
    public static boolean evalBool(String evalstr) {
        REXP x = getRengine().eval(evalstr);

        if (x != null && x.asBool() != null) {
            return x.asBool().isTRUE();
       
        log.error("Error while evaling" + evalstr);
        return false;
    }
View Full Code Here

      // Get the peak list.
      rEngine.eval("peakList <- getPeaklist(an)", false);

      // Extract the pseudo-spectra and isotope annotations from the peak
      // list.
      final REXP spectraExp = rEngine
          .eval("as.integer(peakList$pcgroup)");
      final REXP isotopeExp = rEngine.eval("peakList$isotopes");

      // Add identities.
      if (spectraExp != null) {

        addPseudoSpectraIdentities(peaks, spectraExp, isotopeExp);
View Full Code Here

TOP

Related Classes of org.rosuda.JRI.REXP

Copyright © 2018 www.massapicom. 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.