The R Project SVN R

Rev

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

Rev 71529 Rev 71530
Line 138... Line 138...
138
  the documentation of \code{\link{setOldClass}}.
138
  the documentation of \code{\link{setOldClass}}.
139
 
139
 
140
}
140
}
141
 
141
 
142
\section{Contained S3 Objects}{
142
\section{Contained S3 Objects}{
-
 
143
  Registering an S3 class defines an S4 class.  Objects from this
-
 
144
  class are essentially identical in content to an object from the S3
-
 
145
  class, except for two differences.  The value returned by
-
 
146
  \code{\link{class}()} will always be a single string for the S4
-
 
147
  object, and \code{\link{isS4}()} will return \code{TRUE} or
-
 
148
  \code{FALSE} in the two cases.  See the example below.  It is barely
-
 
149
  possible that some S3 code will not work with the S4 object; if so,
-
 
150
  use \code{as(x, "S3")}.
-
 
151
 
143
  Objects from a class that extends an S3 class will have some basic type and
152
  Objects from a class that extends an S3 class will have some basic type and
144
  possibly some attributes.  For an S3 class that has an equivalent S4
153
  possibly some attributes.  For an S3 class that has an equivalent S4
145
  definition (e.g., \code{"data.frame"}), an extending S4 class will
154
  definition (e.g., \code{"data.frame"}), an extending S4 class will
146
  have a data part and slots.  For other S3 classes (e.g., \code{"lm"}) an
155
  have a data part and slots.  For other S3 classes (e.g., \code{"lm"}) an
147
  object from the extending S4 class will be some sort of basic type,
156
  object from the extending S4 class will be some sort of basic type,