\begin{Schunk}
\begin{Sinput}
 x <- c(1, 2, 3, 3, 2, 1)
 xf <- factor(x, levels = 1:7, labels = letters[1:7])
 str(xf)
\end{Sinput}
\begin{Soutput}
 Factor w/ 7 levels "a","b","c","d",..: 1 2 3 3 2 1
\end{Soutput}
\end{Schunk}
