\Header{class}{Object Classes}
\alias{class$\leftarrow $}{class}
\alias{unclass}{class}
\alias{inherits}{class}
\keyword{methods}{class}
\keyword{classes}{class}
\begin{Usage}
\begin{verbatim}
class(x)
class(x) <- names
unclass(x)
inherits(x, name)
\end{verbatim}
\end{Usage}
\begin{Description}
\R\ possesses a simple generic function mechanism which can be used for
an object-oriented style of programming.  Method despatch takes place
based on the class of the first argument to the generic function.

An \R\ ``object'' is a data object which has a \texttt{class} attribute.
A class attribute is a vector of character strings giving the names of
the classes which the object ``inherits'' from.  When a generic
function \texttt{fun} is applied to an object with class attribute
\texttt{c("first", "second")}, the system searches for a function called
\texttt{fun.first} and, if it finds it, applies it to the object.  If no
such function is found, a function called \texttt{fun.second} is tried.
If no class name produces a suitable function, the function
\texttt{fun.default} is used.

The function \texttt{class} prints the vector of names of classes an
object inherits from.  Correspondingly, \texttt{class<-} sets the
classes an object inherits from.

\texttt{unclass} returns (a copy of) its argument with its class
information removed.

\texttt{inherits} indicates whether its first argument inherits from a
class with name equal to its second argument.\end{Description}
\begin{SeeAlso}
\texttt{\Link{UseMethod}}, \texttt{\Link{NextMethod}}.\end{SeeAlso}

