colprods: Column and row-wise products

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/prods.R

Description

Column and row-wise products.

Usage

1
2
colprods(x, method = "direct")
rowprods(x)

Arguments

x

A matrix with numbers.

method

The type of colCumProds to use. For direct multiplication use "direct" or "expsumlog" for a more numerically stable, but slower way.

Details

The product of the numbers in a matrix is returned either column-wise or row-wise.

Value

A vector with the column or the row products.

Author(s)

Manos Papadakis

R implementation and documentation: Manos Papadakis <papadakm95@gmail.com>.

See Also

colsums, coldiffs, colMedians

Examples

1
2
3
4
5
x <- matrix( runif(100 * 10), ncol = 10 )
res<-colprods(x)
res<-rowprods(x)

x<-NULL

Example output

Loading required package: Rcpp
Loading required package: RcppZiggurat

Rfast documentation built on May 18, 2021, 1:07 a.m.