max_g.Rd
Compute per-group maxs
max_g(col, first_indices, na.rm = FALSE)
col | vector to max |
---|---|
first_indices | numeric index of first index in each group |
na.rm | logical if TRUE remove NAs |
per-group max
v <- c(2, 3, 1, 7, 5) fi <- c(1, 1, 3, 3, 3) max_g(v, fi)#> [1] 3 3 7 7 7