Package org.renjin.sexp

Examples of org.renjin.sexp.Vector


    private int variables;
    private int observations;

    public VariableSet(AtomicVector vector) {
      this.vector = vector;
      Vector dim = (Vector) vector.getAttribute(Symbols.DIM);
      if(dim == Null.INSTANCE) {
        this.observations = vector.length();
        this.variables = 1;
      } else {
        if(dim.length() != 2) {
          throw new EvalException("must be vector or matrix, not higher-order array");
        }
        this.observations = dim.getElementAsInt(0);
        this.variables = dim.getElementAsInt(1);
      }   
    }
View Full Code Here


    return vector + "[" + index + "]";
  }

  @Override
  public Object retrieveValue(Context context, Object[] temps) {
    Vector vectorValue = (Vector) vector.retrieveValue(context, temps);
    Integer indexValue = (Integer)index.retrieveValue(context, temps);
    return vectorValue.getElementAsSEXP(indexValue);
  }
View Full Code Here

TOP

Related Classes of org.renjin.sexp.Vector

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.