\Header{class.ind}{Generates Class Indicator Matrix from a Factor}
\keyword{neural}{class.ind}
\keyword{utilities}{class.ind}
\begin{Description}\relax
Generates a class indicator function from a given factor.\end{Description}
\begin{Usage}
\begin{verbatim}
class.ind(cl)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{cl}] factor or vector of classes for cases.

\end{ldescription}
\end{Arguments}
\begin{Value}
a matrix which is zero except for the column corresponding to the class.\end{Value}
\begin{Examples}
\begin{ExampleCode}
# The function is currently defined as
function(cl)
{
  n <- length(cl)
  cl <- as.factor(cl)
  x <- matrix(0, n, length(levels(cl)))
  x[(1:n) + n * (codes(cl) - 1)] <- 1
  dimnames(x) <- list(row.names(cl), levels(cl))
  x
}
\end{ExampleCode}
\end{Examples}

