\begin{Schunk}
\begin{Sinput}
 nes2002$ideolf <- factor(nes2002$V023022, levels = 1:7, labels = c("EL", "L", "SL", "M", "SC", "C", "EC"))
 table("ideology factor" = nes2002$ideolf, "original ideology" = nes2002$V023022, exclude = NULL)
\end{Sinput}
\begin{Soutput}
               original ideology
ideology factor   1   2   3   4   5   6   7 <NA>
           EL    23   0   0   0   0   0   0    0
           L      0 181   0   0   0   0   0    0
           SL     0   0 135   0   0   0   0    0
           M      0   0   0 340   0   0   0    0
           SC     0   0   0   0 186   0   0    0
           C      0   0   0   0   0 315   0    0
           EC     0   0   0   0   0   0  65    0
           <NA>   0   0   0   0   0   0   0  266
\end{Soutput}
\begin{Sinput}
 nes2002$ideolo <- factor(nes2002$V023022, levels = 1:7, labels = c("EL", "L", "SL", "M", "SC", "C", "EC"), ordered = TRUE)
\end{Sinput}
\end{Schunk}
