Form row and column sums and means for sparse spam matrices

rowSums(x, na.rm = FALSE, dims = 1, ...)
colSums(x, na.rm = FALSE, dims = 1, ...)
rowMeans(x, na.rm = FALSE, dims = 1, ...)
colMeans(x, na.rm = FALSE, dims = 1, ...)

Arguments

x

a spam object

na.rm

currently ignored

dims

ignored as we have only two dimensions.

...

potentially further arguments from other methods.

Details

Depending on the flag .

Value

Vector of appropriate length.

Author

Reinhard Furrer

Examples

x <- spam( rnorm(20), 5, 4)
rowSums( x)
#> [1] -1.2731599  0.2250209 -2.5242495  2.8047041 -1.7852808
c( x %*% rep(1,4))
#> [1] -1.2731599  0.2250209 -2.5242495  2.8047041 -1.7852808