R/residcsum.R

Defines functions residcsum

# This function is internal, used by residuals survfit
# Cumsum of each column, restart the sum anew for each stratum
residcsum <- function(y, strata) {
    if (!is.matrix(y)) stop("y must be a matrix")
    if (!is.integer(strata) || length(strata) != nrow(y))
        stop("invalid strata")
    storage.mode(y) <- "double"
    .Call(Cresidcsum, y, strata)
}

Try the survival package in your browser

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

survival documentation built on Aug. 14, 2023, 9:07 a.m.