NamedTypeTest-class(TypeInfo)
NamedTypeTest-class()所属R语言包:TypeInfo
Class "NamedTypeTest" and sub-classes for tests on class of an object.
“NamedTypeTest”和子类对象类测试类。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These classes are for specifying a test on the type of an object using the class of that object and comparing it to target class names. The tests can be either for 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.
这些类指定测试类型,使用该对象的类和对象,比较目标类名。测试可以是x inherits from class name(is(x, "className"))或x is an instance of class name(即class(x) == "className")。其中第一项是代表InheritsTypeTest和StrictTypeTest第二。
从NamedTypeTest类的对象----------Objects from the NamedTypeTest class----------
Objects can be created for the non-virtual classes using new("InheritsTypeTest",...) and new("StrictIsTypeTest",...) or the convenience functions InheritsTypeTest(...), StrictIsTypeTest(...) Additionally, where appropriate, a character vector is coerced to InheritsTypeTest.
对象可以创建非虚拟类的new("InheritsTypeTest",...)和new("StrictIsTypeTest",...)或便利功能InheritsTypeTest(...),StrictIsTypeTest(...)此外,在适当情况下,特征向量被强迫InheritsTypeTest。
插槽----------Slots----------
.Data: Object of class "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.
.Data类"character"的对象。这是一个内部数据类型来表示的类名。它不直接使用。它是从“人物”类继承。
延伸----------Extends----------
Class "character", from data part. Class "ClassNameOrExpression", directly. Class "vector", by class "character".
类"character",从数据的一部分。类"ClassNameOrExpression",直接。类"vector"类"character"。
方法----------Methods----------
coerce signature(from = "character", to = "NamedTypeTest"):
强制signature(from = "character", to = "NamedTypeTest"):
作者(S)----------Author(s)----------
Duncan Temple Lang <duncan@wald.ucdavis.edu>
参见----------See Also----------
TypedSignature TypeSpecification-class DynamicTypeTest-class
TypedSignatureTypeSpecification-classDynamicTypeTest-class
举例----------Examples----------
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)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|