isS4(object)
asS4(object, flag = TRUE, complete = TRUE)
asS3(object, flag = TRUE, complete = TRUE)
isS4
does not rely on the methods
package, so in particular it can be used to detect the need to
require
that package. asS3
uses the value of
complete
to control whether an attempt is made to transform
object
into a valid object of the implied S3 class. If
complete
is 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 array
and matrix
: such objects will have
their class attribute set to NULL
.
isS4
is primitive.
is.object
for a more general test; Methods
for general information on S4.
isS4(pi) # FALSE
isS4(getClass("MethodDefinition")) # TRUE
Run the code above in your browser using DataLab