Rev 84029 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/slotOp.Rd% Part of the R package, https://www.R-project.org% Copyright 1995-2023 R Core Team% Distributed under GPL 2 or later\name{slotOp}\title{Extract or Replace a Slot or Property}\alias{@}\alias{@<-}\description{Extract or replace the contents of a slot or property of an object.}\usage{object@nameobject@name <- value}\arguments{\item{object}{An object from a formally defined (S4) class, or anobject with a class for which `@` or `@<-` S3 methods are defined.}\item{name}{The name of the slot or property, supplied as a characterstring or unquoted symbol. If \code{object} has an S4 class, then\code{name} must be the name of a slot in the definition of the classof \code{object}.}\item{value}{A suitable replacement value for the slot orproperty. For an S4 object this must be from a class compatiblewith the class defined for this slot in the definition of the classof \code{object}.}}\details{If \code{object} is not an S4 object, then a suitable S3 method for`@` or `@<-` is searched for. If no method is found, then an erroris signaled.if \code{object} is an S4 object, then these operators are for slotaccess, and are enabled only when package \pkg{methods} is loaded (asper default). The slot must be formally defined. (There is anexception for the name \code{.Data}, intended for internal use only.)The replacement operator checks that the slot already exists on theobject (which it should if the object is really from the class itclaims to be). See \code{\link{slot}} for further details, inparticular for the differences between \code{slot()} and the \code{@}operator.These are internal generic operators: see \link{InternalMethods}.}\value{The current contents of the slot.}\seealso{\code{\link{Extract}}, \code{\link{slot}}}\keyword{manip}