R/fastSumID2.R

fastSumID2 <- function (x, group) {
    y <- c(0, cumsum(x)[group])
    out <- y[-1L] - y[-length(y)]
    if (anyNA(out))
        out[is.na(out)] <- -Inf
    out
}
drizopoulos/JMbayes documentation built on Feb. 2, 2021, 12:34 a.m.