Learn R Programming

houba (version 0.1.1)

colMeans,mmatrix-method: Row and Columns sums and means

Description

Methods generalizing the base methods to mmatrix objects

Usage

# S4 method for mmatrix
colMeans(x, output.type)

# S4 method for mmatrix colSums(x, output.type)

# S4 method for mmatrix rowMeans(x, output.type)

# S4 method for mmatrix rowSums(x, output.type)

Value

a mvector or a R vector, depending on the size of the result.

Arguments

x

a dual matrix or array

output.type

type of the result, if it's a mvector (see details)

Details

If the size of the result is greater than houba(max.size), then it will be a mvector instead of R object. In this case its type will be determined using 'output.type'. If 'output.type' is missing, a coherent choice will be made (integer or double).

Examples

Run this code
a <- matrix(1:20, 4, 5)
A <- as.mmatrix(a, "float")
colMeans(A)
rowSums(A)

Run the code above in your browser using DataLab