
Last chance! 50% off unlimited learning
Sale ends in
x inherits from class name
(or is(x, "className")
)
or x is an instance of class name
(i.e. class(x) ==
"className"
).
The first of these is represented by InheritsTypeTest
and the second by StrictTypeTest
.
new("InheritsTypeTest",...)
and new("StrictIsTypeTest",...)
or the convenience functions
InheritsTypeTest(...)
, StrictIsTypeTest(...)
Additionally, where appropriate,
a character vector is coerced to InheritsTypeTest
..Data
:"character"
.
This is an internal data type to represent the class names.
It is not to be used directly. It is inherited from the
“character” class.
"character"
, from data part.
Class "ClassNameOrExpression"
, directly.
Class "vector"
, by class "character"
.signature(from = "character", to =
"NamedTypeTest")
:
converts a character vector into a InheritsTypeTest
.TypedSignature
TypeSpecification-class
DynamicTypeTest-class
new("InheritsTypeTest", c("A", "B"))
m = array(1:60, c(3, 4, 5))
tt = new("StrictIsTypeTest", c("matrix"))
TypeInfo:::checkType(m, tt)
tt = new("StrictIsTypeTest", c("array"))
TypeInfo:::checkType(m, tt)
Run the code above in your browser using DataLab