Exemple #1
0
 private Minimum(Var var) {
   this.varName = var.name();
   for (int i = 0; i < var.rowCount(); i++) {
     if (var.missing(i)) {
       missingCount++;
     } else {
       completeCount++;
     }
   }
   if (var.stream().complete().count() == 0) {
     value = Double.NaN;
   } else {
     value = var.stream().complete().mapToDouble().min().getAsDouble();
   }
 }
Exemple #2
0
  public BoxPlot(Var x, Var factor, GOpt... opts) {

    Map<String, List<Double>> map =
        x.stream().collect(groupingBy(s -> factor.label(s.row()), mapping(VSpot::value, toList())));
    names = factor.streamLevels().filter(map::containsKey).toArray(String[]::new);
    vars = Arrays.stream(names).map(map::get).map(Numeric::copy).toArray(Var[]::new);

    this.options.apply(opts);
    initialize();
  }