sums(slam)
sums()所属R语言包:slam
Form Row and Column Sums and Means
表格的行和列的金额及方式
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Form row and column sums and means for sparse arrays (currently simple_triplet_matrix only).
表格的行和列的金额和手段稀疏数组(目前simple_triplet_matrix)。
用法----------Usage----------
row_sums(x, na.rm = FALSE, dims = 1, ...)
col_sums(x, na.rm = FALSE, dims = 1, ...)
row_means(x, na.rm = FALSE, dims = 1, ...)
col_means(x, na.rm = FALSE, dims = 1, ...)
## S3 method for class 'simple_triplet_matrix'
row_sums(x, na.rm = FALSE, dims = 1, ...)
## S3 method for class 'simple_triplet_matrix'
col_sums(x, na.rm = FALSE, dims = 1, ...)
## S3 method for class 'simple_triplet_matrix'
row_means(x, na.rm = FALSE, dims = 1, ...)
## S3 method for class 'simple_triplet_matrix'
col_means(x, na.rm = FALSE, dims = 1, ...)
参数----------Arguments----------
参数:x
a sparse array containing numeric, integer, or logical values.
稀疏数组,包含数字,整数或逻辑值。
参数:na.rm
logical. Should missing values (including NaN) be omitted from the calculations?
逻辑。如果缺失值(包括NaN)被省略的计算?
参数:dims
currently not used for sparse arrays.
目前不用于稀疏数组。
参数:...
currently not used for sparse arrays.
目前不用于稀疏数组。
Details
详细信息----------Details----------
Provides fast summation over the rows or columns of sparse matrices in simple_triplet-form.
提供快速simple_triplet形式的稀疏矩阵的行或列的求和。
值----------Value----------
A numeric (double) array of suitable size, or a vector if the result is one-dimensional. The dimnames (or names for a vector result) are taken from the original array.
的数值(双)阵列的合适的尺寸,或如果结果是一维的矢量。 dimnames(或names的矢量结果),从原来的数组。
注意----------Note----------
Results are always of storage type double to avoid (integer) overflows.
结果总是存储类型double(整数),以避免溢出。
(作者)----------Author(s)----------
Christian Buchta
参见----------See Also----------
simple_triplet_matrix, colSums for dense numeric arrays.
simple_triplet_matrix,colSums高密度数字阵列。
实例----------Examples----------
##[#]
x <- matrix(c(1, 0, 0, 2, 1, NA), nrow = 3)
x
s <- as.simple_triplet_matrix(x)
row_sums(s)
row_sums(s, na.rm = TRUE)
col_sums(s)
col_sums(s, na.rm = TRUE)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|