Skip to contents

This function takes a data.table and applies a rolling sum over a given timestep, aggregating by specified columns. It's particularly useful for aggregating observations over certain periods.

Usage

enw_rolling_sum(dt, internal_timestep, by = NULL, value_col = "confirm")

Arguments

dt

A data.table to be aggregated.

internal_timestep

An integer indicating the period over which to aggregate.

by

A character vector specifying the columns to aggregate by.

value_col

A character string specifying the column to aggregate. Defaults to "confirm".

Value

A modified data.table with aggregated observations.