找回密码
 注册
查看: 1685|回复: 0

R语言:BasicClasses()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 21:02:05 | 显示全部楼层 |阅读模式
BasicClasses(methods)
BasicClasses()所属R语言包:methods

                                        Classes Corresponding to Basic Data Types
                                         基本数据类型的类通讯

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Formal classes exist corresponding to the basic R object types, allowing these types to be used in method signatures, as slots in class
正规类存在相应的R对象的基本类型,允许用于这些类型的方法签名,在课堂上的插槽,


用法----------Usage----------


### The following are all basic vector classes.
### They can appear as class names in method signatures,
### in calls to as(), is(), and new().
"character"
"complex"
"double"
"expression"
"integer"
"list"
"logical"
"numeric"
"single"
"raw"

### the class
"vector"
### is a virtual class, extended by all the above

### the class
"S4"
### is an object type for S4 objects that do not extend
### any of the basic vector classes.  It is a virtual class.

### The following are additional basic classes
"NULL"     #  NULL objects
"function" #  function objects, including primitives
"externalptr" # raw external pointers for use in C code

"ANY"  # virtual classes used by the methods package itself
"VIRTUAL"
"missing"

"namedList" # the alternative to "list" that preserves
            # the names attribute



从类的对象----------Objects from the Classes----------

Objects can be created by calls of the form new(Class, ...), where Class is the quoted class name, and the remaining arguments if any are objects to be interpreted as vectors of this class.  Multiple arguments will be concatenated.
对象可以创建调用的形式new(Class, ...),Class引用的类的名称,剩下的参数,如果有任何对象被解释为这一类的向量。多个参数将被连接起来。

The class "expression" is slightly odd, in that the ... arguments will not be evaluated; therefore, don't enclose them in a call to quote().
类"expression"是有点奇怪,在那...参数将不进行评估,因此,不括在调用quote()。

Note that class "list" is a pure vector.  Although lists with names go back to the earliest versions of S, they are an extension of the vector concept in that they have an attribute (which can now be a slot) and which is either NULL or a character vector of the same length as the vector.  If you want to guarantee that list names are preserved, use class "namedList", rather than "list".  Objects from this class must have a names attribute, corresponding to slot "names", of type "character".  Internally, R treats names for lists  specially, which makes it impractical to have the corresponding slot in class "namedList" be a union of character names and NULL.
请注意,"list"类是一个纯粹的向量。虽然名称列表回到S的最早版本,他们要么NULL或一个特征向量是一个向量的概念,因为它们有一个属性(可现在是一个插槽)和扩展为向量的长度相同。如果你想,以保证被保存列表的名称,使用类"namedList",而不是"list"。从这个类的对象时,必须有一个名称属性,相应的插槽"names",类型的"character"。在内部,研究处理列表的名称特别,这使得它有相应的插槽中类不切实际的"namedList"是工会角色名称和NULL。


类和类型----------Classes and Types----------

The basic classes include classes for the basic R types.  Note that objects of these types will not usually be S4 objects (isS4 will return FALSE), although objects from classes that contain the basic class will be S4 objects, still with the same type.  The type as returned by typeof will sometimes differ from the class, either just from a choice of terminology (type "symbol" and class "name", for example) or because there is not a one-to-one correspondence between class and type (most of the classes that inherit from class "language" have type "language", for example).
基本类包括基本科研类型的类。请注意,这些类型的对象通常是不会S4对象(isS4将返回FALSE),虽然从类包含的基本类将是中S4中仍然具有相同的类型,对象的对象。类型作为typeof返回有时会不同于类,要么只是从术语的选择(类型"symbol"“类"name",例如),或因为没有一个对一类和类型之间的对应关系("language"类型"language"例如,大部分从类继承的类)。


延伸----------Extends----------

The vector classes extend "vector", directly.
向量类扩展"vector",直接。


方法----------Methods----------




coerce Methods are defined to coerce arbitrary objects to the vector classes, by calling the corresponding basic function, for
定义要挟方法强迫任意对象的Vector类,通过调用相应的基本功能,为

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-2-3 04:55 , Processed in 0.028641 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表