I have a data set:
col1 col2
A 3
A 3
B 2
C 1
B 2
A 3
D 5
B 2
D 5
B 2
F 0
F 0
A 3
C 1
C 1
How can I subset it so as to "leave" the top 2 col1 values. So my output is this:
col1 col2
A 3
A 3
A 3
D 5
A 3
I have viewed this question, but it didn't answer my question.