Package org.renjin.sexp

Examples of org.renjin.sexp.IntArrayVector$Builder


  public Options() {
    map = Maps.newHashMap();
    map.put("prompt", new StringArrayVector("> "));
    map.put("continue", new StringArrayVector("+ "));
    map.put("expressions" , new IntArrayVector(5000));
    map.put("width", new IntArrayVector(80));
    map.put("digits", new IntArrayVector(7));
    map.put("echo", new LogicalArrayVector(false));
    map.put("verbose", new LogicalArrayVector(false));
    map.put("check.bounds", new LogicalArrayVector(false));
    map.put("keep.source", new LogicalArrayVector(true));
    map.put("keep.source.pkgs", new LogicalArrayVector(false));
    map.put("warnings.length", new IntArrayVector(1000));
    map.put("OutDec", new StringArrayVector("."));
  }
View Full Code Here


  }

  @Override
  public SEXP convertToR(Number[] value) {
    if (value == null) {
      return new IntArrayVector(IntVector.NA);
    } else {
      int iArray[] = new int[value.length];
      for (int i = 0; i < value.length; i++) {
        iArray[i] = value[i].intValue();
      }
      return new IntArrayVector(iArray);
    }
  }
View Full Code Here

      }
    }
       
    // now compose the attributes that describe the matrix
    AttributeMap.Builder attributes = AttributeMap.builder();
    attributes.set(Symbols.DIM, new IntArrayVector(modelFrame.getNumRows(), columns.size()));
    attributes.set(Symbols.DIMNAMES, new ListVector(modelFrame.getRowNames(), columnNames(columns)));
    attributes.set(ModelMatrix.ASSIGN, assignment.build());
    // TODO: contrasts

    return new ModelMatrix(modelFrame.getNumRows(), columns, attributes.build());
View Full Code Here

  }

  @Override
  public SEXP convertToR(Number value) {
    if(value == null) {
      return new IntArrayVector(IntVector.NA);
    } else {
      return new IntArrayVector(value.intValue());
    }
  }
View Full Code Here

    // define attibutes
    AttributeMap.Builder attributes = AttributeMap.builder();
    attributes.set("variables", formula.buildVariablesAttribute());
    attributes.set("factors", formula.buildFactorsMatrix());
    attributes.set("term.labels", formula.buildTermLabels());
    attributes.set("order", new IntArrayVector());
    attributes.set("intercept", formula.buildInterceptAttribute());
    attributes.set("response",  formula.buildResponseAttribute());
    attributes.set(".Environment", context.getGlobalEnvironment() );
    attributes.set("class", new StringArrayVector("terms", "formula"));
   
View Full Code Here

public class TransposingMatrixTest {

@Test
  public void transposed() {
    DoubleVector x = new DoubleSequence(1,1,12);
    x = (DoubleVector)x.setAttribute(Symbols.DIM, new IntArrayVector(4,3));

    DoubleVector y = new TransposingMatrix(x, AttributeMap.dim(3, 4));
    assertThat(y.getElementAsDouble(9), equalTo(4d));
    assertThat(y.getElementAsDouble(4), equalTo(6d));
  }
View Full Code Here

   
  }
 

  protected SEXP c_i(int... i) {
    return new IntArrayVector(i);
  }
View Full Code Here

TOP

Related Classes of org.renjin.sexp.IntArrayVector$Builder

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.