Hello
I have a dataframe which resembles this- for example, 2 columns and multiple rows:
A 2
A 7
B 1
B 3
B 6
C 2
I want to do some operations on the items in column two within each unique value of column 1.
I have
unique.values <- sort(unique(mydata[,1]))
This part works for getting each unique value, but I don't know how to associate each unique factor with the values that it takes in column two. I need to be able to operate on each one entirely independently and want to be able to count rows etc. Tried using grep, but couldn't make that work.
Thank you for any help you can give!