I have a data frame with a number of columns, where one of these is error code. Along with the error code, there is a severity code (A to E). I want to create a matrix with the top 10 frequent error codes, alongside the severity code (And possible other variables). How can I do this?
Input:
| Error code | Severity code | Description
1 A
2 A
1 A
3 B
3 B
1 A
Expected output:
| Error code | Severity code | Description | Frequency
1 A 3
3 B 2
2 A 1