Computes aggregates (sums or mean) over defined temporal periods and identifies min/max periods.
var_periods(variable, periodos, n_units, period_length, stat)Matrix with period sums (`num_periods` columns named "period_X"), "min_idx", and "max_idx" columns.
Matrix of temporal values (rows=pixels/cells, cols=units).
List of unit groupings (output from compute_periods).
Integer. Total number of temporal units.
Integer. Length of each period.
Character. Either `"mean"` or `"sum"`, specifying whether to calculate the average or total