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

R语言 slam包 simple_sparse_array()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 09:54:04 | 显示全部楼层 |阅读模式
simple_sparse_array(slam)
simple_sparse_array()所属R语言包:slam

                                        Simple Sparse Arrays
                                         简单的稀疏数组

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

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

Data structures and operators for sparse arrays based on
稀疏数组的数据结构和运营商的基础上


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


simple_sparse_array(i, v, dim = NULL, dimnames = NULL)

as.simple_sparse_array(x)
is.simple_sparse_array(x)

simplify_simple_sparse_array(x, higher = TRUE)
reduce_simple_sparse_array(x, strict = FALSE, order = FALSE)
drop_simple_sparse_array(x)



参数----------Arguments----------

参数:i
Integer matrix of array indices.
整数矩阵数组索引。


参数:v
Vector of values.
向量的值。


参数:dim
Integer vector specifying the size of the dimensions.
整数向量指定的尺寸的大小。


参数:dimnames
either NULL or the names for the dimensions. This is a list with one component for each dimension, either NULL or a character vector of the length given by dim for that dimension.  The list can be named, and the list names will be used as names for the dimensions.  If the list is shorter than the number of dimensions, it is extended by NULL's to the length required.
无论是NULL或名称的尺寸。这是一个列表的每个维度的一个组成部分,无论是NULL或字符向量的长度由dim该维度的。该列表可以被命名,列表中的名称将用作尺寸的名称。如果该列表为短于维度的数目,它是扩展由NULL的所需的长度。


参数:x
An R object; an object of class simple_sparse_array (see Note).
的R对象类的一个对象simple_sparse_array(见注)。


参数:higher
Option to use the dimensions of the values (see Note).
选项的值使用的尺寸(见注)。


参数:strict
Option to treat violations of sparse representation as error (see Note).
治疗侵犯的稀疏表示的错误(见注)的选项。


参数:order
Option to reorder elements (see Note).
元素重新排序的选项(见注)。


Details

详细信息----------Details----------

simple_sparse_array is a generator for a class of “lightweight” sparse arrays,  represented by index matrices and value vectors. Currently, only methods for indexing and coercion are implemented.
simple_sparse_array是一类“轻量级”为代表的指数矩阵和值向量的稀疏数组,一台发电机。目前,只有索引和胁迫的方法来实现。


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

The zero element is defined as vector(typeof(v), 1L), for example, FALSE for logical values (see vector). Clearly, sparse arrays should not contain zero elements, however, for performance reasons the class generator does not remove them.
零元素被定义为vector(typeof(v), 1L),例如,FALSElogical值(见vector)。显然,稀疏数组不应该包含零个元素,但是,出于性能方面的考虑,类生成不删除它们。

If strict = FALSE (default) reduce_simple_sparse_array tries to repair violations of sparse representation (zero, multiple elements), otherwise it stops. If order = TRUE the elements are further reordered (see array).
如果strict = FALSE(默认)reduce_simple_sparse_array尝试修复违反稀疏表示(零,多个元素),否则将停止。如果order = TRUE进一步重新排序的元素(见array)。

simplify_simple_sparse_array tries to reduce v. If higher = TRUE (default) augments x by the common dimensions of v (from the left), or the common length. Note that scalar elements are never extended and unused dimensions never dropped.
simplify_simple_sparse_array试图减少v。如果higher = TRUE(默认)增强xv(从左边起),或共同长度的由共同的尺寸。需要注意的是标量元素是永不永不掉线的扩展和使用的尺寸。

drop_simple_sparse_array drops unused dimensions.
drop_simple_sparse_array删除未使用的尺寸。


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

simple_triplet_matrix for sparse matrices.
simple_triplet_matrix稀疏矩阵。


实例----------Examples----------


x <- array(c(1, 0, 0, 2, 0, 0, 0, 3), dim = c(2, 2, 2))
s <- as.simple_sparse_array(x)
identical(x, as.array(s))

simple_sparse_array(matrix(c(1, 3, 1, 3, 1, 3), nrow = 2), c(1, 2))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-25 22:46 , Processed in 0.029490 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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