I'm still pretty new to R, so I would appreciate any help with the next task. I have a data frame or matrix consisting of ~ 800 rows and two columns, “AA”, which indicates the position of the amino acid in the protein and the “Report” column, which has the number of mutations that fall into this particular position. The problem is that since there can be different mutations in the same position, I can have several lines for the same position, each of which has different values. The initial data would like this (since there is no table support, please read one pair in pairs, 1 5, 100 18, 102 2, etc.):
AA Reported
1 5
100 18
102 2
102 13
103 4
103 3
103 2
103 3
I would like to skip this table and create a new one that will only contain the amounts for each unique mutation position. The output should be as follows:
AA Reported
1 5
100 18
102 15
103 12
I would be happy for any help. This is a good opportunity to learn something new.
user2179095
source
share