\Header{data.class}{Object Classes}
\keyword{classes}{data.class}
\keyword{methods}{data.class}
\begin{Usage}
\begin{verbatim}
data.class(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\texttt{x}] an \R\ object
\end{ldescription}
\end{Arguments}
\begin{Value}
character string giving the ``class'' of \texttt{x}.

The ``class'' is the (first element) of the class attribute if this is
non-\texttt{NULL}, or inferred from the object's \texttt{dim} attribute if
this is non-\texttt{NULL}, or \texttt{mode(x)}.

Simply speaking, \texttt{data.class(x)} returns what is typically useful
for method dispatching.  (Or, what the basic creator functions already
and maybe eventually all will attach as a class attribute.)\end{Value}
\begin{SeeAlso}
\texttt{\Link{class}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
x <- LETTERS
data.class(factor(x))                 # has a class attribute
data.class(matrix(x, nc = 13))        # has a dim attribute
data.class(list(x))                   # the same as mode(x)
data.class(x)                         # the same as mode(x)
\end{ExampleCode}
\end{Examples}

