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

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

[复制链接]
发表于 2012-2-16 18:24:34 | 显示全部楼层 |阅读模式
Matrix-class(Matrix)
Matrix-class()所属R语言包:Matrix

                                        Virtual Class "Matrix" Class of Matrices
                                         虚拟教室“黑客帝国”的一类矩阵

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

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

The Matrix class is a class contained by all actual classes in the Matrix package.  It is a “virtual” class.
Matrix类Matrix包中的所有实际的类中的一类。这是一个“虚拟”的类。


插槽----------Slots----------

Common to all matrix objects in the package:
常见的矩阵包中的所有对象:




Dim: Object of class "integer" - the dimensions of the matrix - must be an integer vector with exactly two
Dim"integer" - 矩阵的尺寸 - 必须是一个整数向量正好有两个:对象类




Dimnames: list of length two; each component containing NULL or a character vector length
Dimnames:长度为二的名单;每个组件包含NULL或一个character向量的长度


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




determinant signature(x = "Matrix", logarithm = "missing"): and
的行列式signature(x = "Matrix", logarithm = "missing"):




determinant signature(x = "Matrix", logarithm = "logical"): compute the (\log) determinant of x.  The method chosen depends on the actual Matrix class of x.  Note that det also works for all our matrices, calling the appropriate determinant() method.  The Matrix::det is an exact copy of base::det, but in the correct namespace, and hence calling the S4-aware version of
行列式signature(x = "Matrix", logarithm = "logical"):计算(\log)x的决定性因素。方法的选择取决于实际的xMatrix类。注意det也适用于我们所有的矩阵,调用相应的determinant()方法。 Matrix::det是base::det完全相同的副本,但在正确的命名空间,因此调用S4感知的版本




diff signature(x = "Matrix"): As diff() for traditional matrices, i.e., applying diff() to each
差异signature(x = "Matrix"):diff()为传统的矩阵,即应用diff()每个




dim signature(x = "Matrix"): extract matrix dimensions
朦胧signature(x = "Matrix"):提取矩阵尺寸




dim<- signature(x = "Matrix", value = "ANY"): where value is integer of length 2.  Allows to reshape
昏暗< - signature(x = "Matrix", value = "ANY")其中value是长度为2的整数。允许将重塑




dimnames signature(x = "Matrix"): extract
dimnamessignature(x = "Matrix"):提取




dimnames<- signature(x = "Matrix", value = "list"): set the dimnames to a list of length 2, see
dimnames < - signature(x = "Matrix", value = "list"):dimnameslist的长度为2的,




length signature(x = "Matrix"): simply defined as
长度signature(x = "Matrix"):简单地定义为




show signature(object = "Matrix"): show
显示signature(object = "Matrix"):show




image signature(object = "Matrix"): draws an image of the matrix entries, using
图像signature(object = "Matrix"):绘制一个矩阵项image,使用




head signature(object = "Matrix"): return only the
头signature(object = "Matrix"):只返回




tail signature(object = "Matrix"): return only the
尾巴signature(object = "Matrix"):返回




as.matrix, as.array signature(x = "Matrix"): the same as
as.matrix,as.arraysignature(x = "Matrix"):一样




as.vector signature(x = "Matrix", mode = "missing"): as.vector(m) should be identical to as.vector(as(m,
as.vectorsignature(x = "Matrix", mode = "missing"):as.vector(m)应该是相同的到的<code> as.vector((米,




as(x, &quot;vector&quot;), as(x, &quot;numeric&quot;) etc, similarly.
为(x,“向量”),(X,“数字”)等,与此类似。

There are many more methods that (conceptually should) work for all "Matrix" objects, e.g., colSums, rowMeans.  Even base functions may work automagically (if they first call as.matrix() on their principal argument), e.g., apply, eigen, svd or kappa all do work via coercion to a &ldquo;traditional&rdquo; (dense) matrix.
还有更多的方法,概念应该为所有"Matrix"对象,例如,colSums,rowMeans。甚至base的功能可能会自动地工作(如果首先把他们称为as.matrix()其主要参数),例如,apply,eigen,svd或kappa 都做工作,通过强制一个“传统”(密)matrix。


注意----------Note----------

Loading the Matrix namespace &ldquo;overloads&rdquo; as.matrix and as.array in the base namespace by the equivalent of function(x) as(x, "matrix"). Consequently, as.matrix(m) or as.array(m) will properly work when m inherits from the "Matrix" class &mdash; also for functions in package base and other packages. E.g., apply or outer can therefore be applied to "Matrix" matrices.
载入Matrix命名空间“重载”as.matrix和as.arraybase的相当于function(x) as(x, "matrix")的命名空间。因此,as.matrix(m)或as.array(m)正常工作时,m"Matrix"类继承 - 还包base和其他包中的功能。例如,apply或outer,因此可以被应用到"Matrix"矩阵。


作者(S)----------Author(s)----------


Douglas Bates <a href="mailto:bates@stat.wisc.edu">bates@stat.wisc.edu</a> and Martin Maechler



参见----------See Also----------

the classes dgeMatrix, dgCMatrix, and function Matrix for construction (and examples).
类dgeMatrix,dgCMatrix,功能Matrix建设(例子)。

Methods, e.g., for kronecker.
方法,例如,kronecker。


举例----------Examples----------


slotNames("Matrix")

cl <- getClass("Matrix")
names(cl@subclasses) # more than 40 ..[超过40更多..]

showClass("Matrix")#&gt; output with slots and all subclasses[>输出插槽和所有子类]

(M <- Matrix(c(0,1,0,0), 6, 4))
dim(M)
diag(M)
cm <- M[1:4,] + 10*Diagonal(4)
diff(M)
## can reshape it even :[#可以重塑甚至:]
dim(M) <- c(2, 12)
M
stopifnot(identical(M, Matrix(c(0,1,0,0), 2,12)),
          all.equal(det(cm),
                    determinant(as(cm,"matrix"), log=FALSE)$modulus,
                    check.attr=FALSE))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 11:52 , Processed in 0.027608 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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