R/col_cumsum.R

Defines functions .col_cumsum

#' Cumulative sums of each column of a matrix
#'
#' @param x Numeric matrix.
#' @return Matrix of the same dimension.
#' @noRd
.col_cumsum <- function(x) {
  x <- as.matrix(x)
  for (j in seq_len(ncol(x))) {
    x[, j] <- cumsum(x[, j])
  }
  x
}

Try the DesignComplexSurvival package in your browser

Any scripts or data that you put into this service are public.

DesignComplexSurvival documentation built on Nov. 23, 2026, 5:07 p.m.