code: private ValFrame colwiseWhichVal(Frame fr, final boolean na_rm) {
          Frame res = new Frame();
  
          Vec vec1 = Vec.makeCon(null, 0);
          assert vec1.length() == 1;
  
          for (int i = 0; i < fr.numCols(); i++) {
              Vec v = fr.vec(i);
              double searchValue = op(v);
              boolean valid = (v.isNumeric() || v.isTime() || v.isBinary()) && v.length() > 0 && (na_rm || v.naCnt() == 0);
              FindIndexCol findIndexCol = new FindIndexCol(searchValue).doAll(new byte[]{Vec.T_NUM}, v);
              Vec newvec = vec1.makeCon(valid ? findIndexCol._valIndex : Double.NaN, v.isTime()? Vec.T_TIME : Vec.T_NUM);
              res.add(fr.name(i), newvec);
          }
  
          vec1.remove();
          return new ValFrame(res);
      }
docs: Compute column-wise (i.e.value index of each column), and return a frame having a single row.