I have a dataset with a set of values dispersed over multiple columns:
| ID | Priority 1 | Priority 2 | Priority 3 |
|---|---|---|---|
| 2308 | Writing | Reading | Reading |
| 0329 | Reading | Communication | Writing |
| 2389 | Communication | Writing | Communication |
| 2934 | Writing | Communication | Writing |
And I would like the output to be a table where the first column are the unique values found (Writing, Reading, Communication) and the rest of the columns are the priorities (Priority 1, Priority 2, Priority 3). In each column should be the count of the priority witin that instance. The output should look like:
| Priority Type | Priority 1 | Priority 2 | Priority 3 |
|---|---|---|---|
| Writing | 2 | 1 | 2 |
| Reading | 1 | 1 | 1 |
| Communication | 1 | 2 | 1 |
In my actual dataset, there are many priorities so if possible could we include 1:n for columns?
Thank you in advance.
*Edit Table has been updated with new column for clarification. I would like to ignore the ID column completely and only have a count of the priorities in each of the priorities columns.