Rev 16802 | Blame | Last modification | View Log | Download | RSS feed
\name{class}\alias{class}\alias{class<-}\title{Class of an Object}\description{Returns the name of the object's class as a character string.In contrast to the version of this function in the base package, thisversion of \code{class} never returns \code{NULL}. For objects thatdo not have a formal class definition, and do not have the\code{"class"} attribute set, the value returned is effectively thesame as \code{data.class}.The replacement version of the function sets the class to the valueprovided. For classes that have a formal definition, directlyreplacing the class this way is strongly deprecated. The expression\code{as(object, value)} is the way to coerce an object to aparticular class.}\usage{class(object)class(object) <- value}\arguments{\item{object}{Any R object (including basic objects for which no class iscurrently defined). When assigning the class, however, it must bepossible to coerce the object to the specified class: the semanticsof assigning a class to \code{object} are equivalent to\code{object <- as(object, value)}.}}\references{The web page \url{http://www.omegahat.org/RSMethods/index.html} is theprimary documentation.The functions in this package emulate the facility for classes andmethods described in \emph{Programming with Data} (John M. Chambers,Springer, 1998). See this book for further details and examples.}\author{John Chambers}\seealso{\code{\link{as}}}\keyword{programming}\keyword{classes}