\HeaderA{typeof}{The Type of an Object}{typeof}
\aliasA{type}{typeof}{type}
\keyword{attribute}{typeof}
\begin{Description}\relax
\code{typeof} determines the (\R{} internal)
type or storage mode of any object
\end{Description}
\begin{Usage}
\begin{verbatim}
typeof(x)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] any \R{} object.
\end{ldescription}
\end{Arguments}
\begin{Value}
A character string.  The possible values are listed in the structure
\code{TypeTable} in \file{src/main/util.c}. Current values are
the vector types \code{"logical"}, \code{"integer"}, \code{"double"},
\code{"complex"}, \code{"character"}, \code{"raw"} and \code{"list"},
\code{"NULL"},
\code{"closure"} (function), \code{"special"} and \code{"builtin"}
(basic functions and operators), \code{"environment"}, \code{"S4"}
(some S4 objects) and others that are unlikely to be seen at user
level (\code{"symbol"}, \code{"pairlist"}, \code{"promise"},
\code{"language"}, \code{"char"}, \code{"..."}, \code{"any"},
\code{"expression"}, \code{"externalptr"}, \code{"bytecode"} and
\code{"weakref"}).
\end{Value}
\begin{SeeAlso}\relax
\code{\LinkA{mode}{mode}}, \code{\LinkA{storage.mode}{storage.mode}}.

\code{\LinkA{isS4}{isS4}} to determine if an object has an S4 class.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
typeof(2)
mode(2)
\end{ExampleCode}
\end{Examples}

