\Header{class}{Class of an Object}
\alias{class<\Rdash}{class}
\keyword{programming}{class}
\keyword{classes}{class}
\begin{Description}\relax
Returns the name of the object's class as a character string.

In contrast to the version of this function in the base package, this
version of \code{class} never
returns \code{NULL}.  For objects that do not have a formal class
definition, and do not have the \code{"class"} attribute set, the
value returned is effectively the same as \code{data.class}.

The replacement version of the function sets the class to the value
provided.  For classes that have a formal definition, directly
replacing the class this way is strongly deprecated.  The expression
\code{as(object, value)} is the way to coerce an object to a
particular class.\end{Description}
\begin{Usage}
\begin{verbatim}
class(object)

class(object) <- value
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{object}] Any R object (including basic objects for which no class is currently
defined).  When assigning the class, however, it must be possible to
coerce the object to the specified class:  the semantics of assigning
a class to \code{object} are equivalent to \code{object <- as(object, value)}.

\end{ldescription}
\end{Arguments}
\begin{Author}\relax
John Chambers\end{Author}
\begin{References}\relax
The web page \url{http://www.omegahat.org/RSMethods/index.html} is the primary documentation.

The functions in this package emulate the facility for classes and methods described in
\emph{Programming with Data}, (John M. Chambers, Springer, 1998).  See this book
for further details and examples.\end{References}
\begin{SeeAlso}\relax
\code{\Link{as}}\end{SeeAlso}

