\begin{Schunk}
\begin{Sinput}
  dat$grpfac1 <- factor(dat$grp, labels = c("Number1", "Number2", "Number3"))
  str(dat$grpfac1)
\end{Sinput}
\begin{Soutput}
 Factor w/ 3 levels "Number1","Number2",..: 1 2 1 3 1 1 2 2 2 1 ...
\end{Soutput}
\begin{Sinput}
  with(dat, table(grp, grpfac1))
\end{Sinput}
\begin{Soutput}
   grpfac1
grp Number1 Number2 Number3
  1       6       0       0
  2       0       7       0
  3       0       0       6
\end{Soutput}
\end{Schunk}
