\begin{Schunk}
\begin{Sinput}
 library(plyr)
 dat$w5 <- mapvalues(dat$w2, from = c("f", "g", "h", "i", "j"), to = c("John", "Paul", "George", "Ringo", "Erik"))
 str(dat$w5)
\end{Sinput}
\begin{Soutput}
 Factor w/ 5 levels "John","Paul",..: 2 1 4 3 2 4 3 1 5 2 ...
\end{Soutput}
\end{Schunk}
