rowProds {matrixStats}R Documentation

Calculates the product for each row (column) in a matrix

Description

Calculates the product for each row (column) in a matrix.

Usage

 rowProds(x, ...)
 colProds(x, ...)

Arguments

x A numeric NxK matrix.
... Arguments passed to rowSums().

Details

Internally the product is calculated via the logarithmic transform, treating zeros and negative values specially.

Value

Returns a numeric vector of length N (K).

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)


[Package matrixStats version 0.1.6 Index]