\begin{Schunk}
\begin{Sinput}
 dat$y2 <- dat$y
 dat$y2[dat$y2 > 11] <- NA
 ## I run this to save space in output
 table(is.na(dat$y2), dat$y, exclude = NULL)
\end{Sinput}
\begin{Soutput}
        6 8 9 10 11 12 13 14 15 16 17 18
  FALSE 2 4 5  4  7  0  0  0  0  0  0  0
  TRUE  0 0 0  0  0  1  6  5  5  4  3  2
\end{Soutput}
\begin{Sinput}
 ## Could as well do
 ## table(dat$y2, dat$y, exclude = NULL)
\end{Sinput}
\end{Schunk}
