I try to build the ranks according to groups based on the values of two variables in R.
Data example:
A B group rank
9 2 C 3
12 9 C 2
12 10 C 1
8 5 C 4
8 5 C 4
10 3 D 5
15 10 D 1
14 12 D 2
14 8 D 3
14 8 D 3
I know how to use group_by and rank; however, if I wanna use frank and by = group; it does not work.
Thank you very much!