예제 #1
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();
  }