Dear list members!
I am looking for ''nice solution'' for (maybe) simple problem. I need a code (small program) to calculate row index for max value (example below: df1$values) by groups (example below: df1$groups).
df1 <- data.frame(
groups = c(1,1,1,1,1,2,2,2,3,3,3,3),
values = c(1,1,1,2,1,1,2,3,2,1,4,3)
)
df1

expected results

> 4 8 11 # row index of max values by group 
Thansk to all for help, OV

	[[alternative HTML version deleted]]

