private ValFrame cleanCategorical(Frame oldfr, Frame newfr) {
    final boolean categoricalOK = categoricalOK();
    final Vec oldvecs[] = oldfr.vecs();
    final Vec newvecs[] = newfr.vecs();
    Futures fs = new Futures();
    for (int i = 0; i < oldvecs.length; i++)
      if ((oldvecs[i].isCategorical() && !categoricalOK)) { // categorical are OK (op is EQ/NE)
        Vec cv = newvecs[i].makeCon(Double.NaN);
        newfr.replace(i, cv).remove(fs);
      }
    fs.blockForPending();
    return new ValFrame(newfr);
  }
private ValFrame cleanCategorical ( Frame oldfr , Frame newfr ) { final boolean categoricalOK = categoricalOK ( ) ; final Vec oldvecs [ ] = oldfr . vecs ( ) ; final Vec newvecs [ ] = newfr . vecs ( ) ; Futures fs = new Futures ( ) ; for ( int i = 0 ; i < oldvecs . length ; i ++ ) if ( ( oldvecs [ i ] . isCategorical ( ) && ! categoricalOK ) ) { Vec cv = newvecs [ i ] . makeCon ( Double . NaN ) ; newfr . replace ( i , cv ) . remove ( fs ) ; } fs . blockForPending ( ) ; return new ValFrame ( newfr ) ; }
Ops do not make sense on categoricals, except EQ/NE; flip such ops to NAs