cummax_g.Rd
Compute per-group cumulative maxs
cummax_g(col, first_indices)
col | vector to cumulative max |
---|---|
first_indices | numeric index of first index in each group |
per-group cumulative max
v <- c(2, 3, 1, 7, 5) fi <- c(1, 1, 3, 3, 3) cummax_g(v, fi)#> [1] 2 3 1 7 7