\begin{Schunk}
\begin{Sinput}
 dat$w7 <- dat$w2
 dat$w7[dat$w7 %in% c("i","j")] <- NA
 table(dat$w7, exclude = NULL)
\end{Sinput}
\begin{Soutput}
   f    g    h    i    j <NA> 
   8   14    8    0    0   18 
\end{Soutput}
\end{Schunk}
