The R Project SVN R

Rev

Rev 51966 | Rev 59039 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 51966 Rev 56211
Line 1... Line 1...
1
% File src/library/methods/man/StructureClasses.Rd
1
% File src/library/methods/man/StructureClasses.Rd
2
% Part of the R package, http://www.R-project.org
2
% Part of the R package, http://www.R-project.org
3
% Copyright 1995-2007 R Core Development Team
3
% Copyright 1995-2011 R Core Development Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{StructureClasses}
6
\name{StructureClasses}
7
\title{Classes Corresponding to Basic Structures}
7
\title{Classes Corresponding to Basic Structures}
8
\docType{class}
8
\docType{class}
Line 49... Line 49...
49
  \code{matrix()}.  There is no particular advantage over calling those
49
  \code{matrix()}.  There is no particular advantage over calling those
50
  functions directly, unless you are writing software designed to work
50
  functions directly, unless you are writing software designed to work
51
  for multiple classes, perhaps with the class name and the arguments
51
  for multiple classes, perhaps with the class name and the arguments
52
  passed in.
52
  passed in.
53
 
53
 
54
  Objects created from the classes \code{"matrix"} and \code{"array"} are unusual, to put
54
  Objects created from the classes \code{"matrix"} and \code{"array"}
55
  it mildly, and have been for some time.  Although they may appear to
55
  are unusual, to put it mildly, and have been for some time.  Although
56
  be objects from these classes, they do not have the internal
56
  they may appear to be objects from these classes, they do not have the
57
  structure of either an S3 or S4 class object.  In particular, they
57
  internal structure of either an S3 or S4 class object.  In particular,
58
  have no \code{"class"} attribute and are not recognized as objects
58
  they have no \code{"class"} attribute and are not recognized as
59
  with classes (that is, both \code{\link{is.object}} and
59
  objects with classes (that is, both \code{\link{is.object}} and
60
  \code{\link{isS4}} will return \code{FALSE} for such objects).
60
  \code{\link{isS4}} will return \code{FALSE} for such objects).
61
  However, methods (both S4 and S3) can be defined for these
61
  However, methods (both S4 and S3) can be defined for these
62
  pseudo-classes and new classes (both S4 and S3) can inherit from them.
62
  pseudo-classes and new classes (both S4 and S3) can inherit from them.
63
 
63
 
64
  That the objects still behave as if they came from the corresponding
64
  That the objects still behave as if they came from the corresponding
Line 109... Line 109...
109
  The limitation is that a class that has more than one non-virtual
109
  The limitation is that a class that has more than one non-virtual
110
  superclass must accept objects from that superclass in the call to
110
  superclass must accept objects from that superclass in the call to
111
  \code{\link{new}}; therefore, a such a class (what is called a
111
  \code{\link{new}}; therefore, a such a class (what is called a
112
  \dQuote{mixin} in some languages) uses the default method for
112
  \dQuote{mixin} in some languages) uses the default method for
113
  \code{\link{initialize}}, with no special arguments.
113
  \code{\link{initialize}}, with no special arguments.
114
  
114
 
115
}
115
}
116
\section{Extends}{
116
\section{Extends}{
117
  The specific classes all extend class \code{"structure"}, directly, and
117
  The specific classes all extend class \code{"structure"}, directly, and
118
  class \code{"vector"}, by class \code{"structure"}.
118
  class \code{"vector"}, by class \code{"structure"}.
119
}
119
}
Line 142... Line 142...
142
    }
142
    }
143
  }
143
  }
144
}
144
}
145
\seealso{Class \linkS4class{nonStructure}, which enforces the
145
\seealso{Class \linkS4class{nonStructure}, which enforces the
146
  alternative model, in which all slots are dropped if any math
146
  alternative model, in which all slots are dropped if any math
147
  transformation or operation is applied to an object from a class extending one of
147
  transformation or operation is applied to an object from a class
148
  the basic classes.
148
  extending one of the basic classes.
149
}
149
}
150
\references{
150
\references{
151
 Chambers, John M. (2008)
151
 Chambers, John M. (2008)
152
 \emph{Software for Data Analysis: Programming with R}
152
 \emph{Software for Data Analysis: Programming with R}
153
  Springer.  (For the R version.)
153
  Springer.  (For the R version.)