Examples of RVector


Examples of com.oracle.truffle.r.runtime.data.RVector

    @SlowPath
    protected Object unClass(RAbstractVector arg) {
        controlVisibility();
        if (arg.isObject()) {
            objectProfile.enter();
            RVector resultVector = arg.materialize();
            if (resultVector.isShared()) {
                resultVector = resultVector.copy();
            }
            return RVector.setClassAttr(resultVector, null, null);
        }
        return arg;
    }
View Full Code Here

Examples of com.oracle.truffle.r.runtime.data.RVector

    @Specialization
    @SlowPath
    protected RAbstractVector updateLevels(RAbstractVector vector, @SuppressWarnings("unused") RNull levels) {
        controlVisibility();
        RVector v = vector.materialize();
        v.setLevels(null);
        return v;
    }
View Full Code Here

Examples of com.oracle.truffle.r.runtime.data.RVector

    @Specialization
    @SlowPath
    protected RAbstractVector updateLevels(RAbstractVector vector, Object levels) {
        controlVisibility();
        RVector v = vector.materialize();
        v.setLevels(levels);
        return v;

    }
View Full Code Here

Examples of com.oracle.truffle.r.runtime.data.RVector

    @Specialization(guards = "isLengthOne")
    @SlowPath
    protected RAbstractVector updateLength(RAbstractVector vector, RAbstractIntVector lengthVector) {
        controlVisibility();
        int length = lengthVector.getDataAt(0);
        RVector resultVector = vector.materialize();
        if (resultVector.isShared()) {
            sharedVectorSeen.enter();
            resultVector = resultVector.copy();
            resultVector.markNonTemporary();
        }
        resultVector.resizeWithNames(length);
        return resultVector;
    }
View Full Code Here

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

Examples of org.rosuda.JRI.RVector

      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

Examples of org.rosuda.JRI.RVector

        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

Examples of org.rosuda.JRI.RVector

    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

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
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.