asS4(object, flag = TRUE, complete = TRUE) asS3(object, flag = TRUE, complete = TRUE)
FALSEaccording to whether the internal flag marking an S4 object has been turned on for this object.
asS3will turn this flag on or off, and
asS3will set the class from the objects
.S3Classslot if one exists. Note that
asS3will not turn the object into an S3 object unless there is a valid conversion; that is, an object of type other than
"S4"for which the S4 object is an extension, unless argument
isS4does not rely on the methods package, so in particular it can be used to detect the need to
asS3uses the value of
completeto control whether an attempt is made to transform
objectinto a valid object of the implied S3 class. If
TRUE, then an object from an S4 class extending an S3 class will be transformed into an S3 object with the corresponding S3 class (see
S3Part). This includes classes extending the pseudo-classes
matrix: such objects will have their class attribute set to
is.objectfor a more general test; Introduction for general information on S4; Classes_Details for more on S4 class definitions.