\begin{Schunk}
\begin{Sinput}
 dat$w8 <- mapvalues(dat$w2, from = c("f", "g"), to = c("Roosevelt", "Lincoln"))
 table(dat$w8)
\end{Sinput}
\begin{Soutput}
Roosevelt   Lincoln         h         i         j 
        8        14         8        13         5 
\end{Soutput}
\end{Schunk}
