\begin{Schunk}
\begin{Sinput}
 dat$schtype <- factor(dat$private, levels = c("1","2"), labels = c("public","private"))
 ## Proofread
 table(dat$schtype, dat$private, exclude = NULL)
\end{Sinput}
\begin{Soutput}
            1   2 <NA>
  public  470   0    0
  private   0 832    0
  <NA>      0   0    0
\end{Soutput}
\begin{Sinput}
 levels(dat$schtype)
\end{Sinput}
\begin{Soutput}
[1] "public"  "private"
\end{Soutput}
\end{Schunk}
