\begin{Schunk}
\begin{Sinput}
 x <- c(1, 2, 1, 2, 2, 7)
 xf <- factor(x, levels = c(7, 2, 1), labels = c("seven","two", "one"))
 levels(xf)
\end{Sinput}
\begin{Soutput}
[1] "seven" "two"   "one"  
\end{Soutput}
\end{Schunk}
