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(); } }
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(); }