Learn R Programming

riskRegression (version 2022.09.23)

rowCumProd: Apply cumprod in each row

Description

Fast computation of t(apply(x,1,cumprod))

Usage

rowCumProd(x)

Value

A matrix of same size as x.

Arguments

x

A matrix.

Author

Thomas Alexander Gerds <tag@biostat.ku.dk>

Examples

Run this code
x <- matrix(1:8,ncol=2)
rowCumProd(x)

Run the code above in your browser using DataLab