Package org.rosuda.JRI

Examples of org.rosuda.JRI.RVector


    try {
      REXP x;
      re.eval("data(iris)",false);
      System.out.println(x=re.eval("iris"));
      // generic vectors are RVector to accomodate names
      RVector v = x.asVector();
      if (v.getNames()!=null) {
        System.out.println("has names:");
        for (Enumeration e = v.getNames().elements() ; e.hasMoreElements() ;) {
          System.out.println(e.nextElement());
        }
      }
      // for compatibility with Rserve we allow casting of vectors to lists
      RList vl = x.asList();
View Full Code Here


      re.eval("plot(fmh,displayisolates = FALSE, vertex.col = \"Grade\", vertex.cex = 0.7)");
     
      re.eval("data(iris)",false);
      System.out.println(x=re.eval("iris"));
      // generic vectors are RVector to accomodate names
      RVector v = x.asVector();
      if (v.getNames()!=null) {
        System.out.println("has names:");
        for (Enumeration e = v.getNames().elements() ; e.hasMoreElements() ;) {
          System.out.println(e.nextElement());
        }
      }
      // for compatibility with Rserve we allow casting of vectors to lists
      RList vl = x.asList();
View Full Code Here

        String str = rResult.asString();
        predictedValues.put(name, str);
        break;
       
      case REXP.XT_VECTOR:
        RVector rVector = rResult.asVector();
        Map<String, Object> vectorSubResult = new HashMap<String, Object>();
        for (Object vName : rVector.getNames()) {
          processRResult(rVector.at(vName.toString()), vectorSubResult, vName.toString());
        }
        predictedValues.put(name, vectorSubResult);
        break;
       
      case REXP.XT_LIST:
View Full Code Here

    public double[][] asDoublesMatrix() {
        if (rexp == null) {
            return null;
        }

        RVector vetor = rexp.asVector();
        if (vetor == null) {
            return null;
        }
        REXP r = (REXP) vetor.get(0);
        double[][] ret = new double[vetor.size()][((double[]) r.getContent()).length];


        for (int col = 0; col < ret.length; col++) {
            REXP coluna = (REXP) vetor.get(col);
            for (int lin = 0; lin < ret[col].length; lin++) {
                ret[col][lin] = ((double[]) coluna.getContent())[lin];
            }
        }
        return ret;
View Full Code Here

    try {
      REXP x;
      re.eval("data(iris)",false);
      System.out.println(x=re.eval("iris"));
      // generic vectors are RVector to accomodate names
      RVector v = x.asVector();
      if (v.getNames()!=null) {
        System.out.println("has names:");
        for (Enumeration e = v.getNames().elements() ; e.hasMoreElements() ;) {
          System.out.println(e.nextElement());
        }
      }
      // for compatibility with Rserve we allow casting of vectors to lists
      RList vl = x.asList();
View Full Code Here

TOP

Related Classes of org.rosuda.JRI.RVector

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.