Learn R Programming

scanstatistics (version 0.1.0)

cumsum_duration: Calculates the cumulative sum of columns over duration, by other columns.

Description

This function calculates the cumulative sum over the (column) duration for one or more columns, by some other columns.

Usage

cumsum_duration(table, sumcols, bycols)

Arguments

table

A data.table with column duration and other columns matching the other arguments to the function.

sumcols

A character vector of the columns to calculate the cumulative sum for.

bycols

A character vector of the columns to calculate the cumulative sum by (i.e. as the argument by to a data.table).

Value

A data.table with the cumulative sums over duration.