R/irtc_aggregate_derivative_information.R

Defines functions irtc_aggregate_derivative_information

# IRTC
# Copyright (C) 2026 WEIAN DATA TECH (Beijing) Co., Ltd.
# SPDX-License-Identifier: GPL-2.0-or-later
# See inst/COPYRIGHTS for licensing details.

## File Name: irtc_aggregate_derivative_information.R

irtc_aggregate_derivative_information <- function(deriv, groups)
{
    totals <- stats::aggregate(deriv, list(groups), sum)
    totals[totals[, 1] == 0, 2] <- 0
    group_rows <- match(groups, totals[, 1])
    totals[group_rows, 2]
}

Try the IRTC package in your browser

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

IRTC documentation built on July 24, 2026, 5:07 p.m.