Learn R Programming

riskRegression (version 2022.03.22)

colCumProd: Apply cumprod in each column

Description

Fast computation of apply(x,2,cumprod)

Usage

colCumProd(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)
colCumProd(x)

Run the code above in your browser using DataLab