My data looks like this
| a | b | c | d | e | f |
|---|---|---|---|---|---|
| High | Low | High | Medium | Low | High |
| High | Medium | Low | High | Medium | Low |
| High | Low | High | Medium | Low | High |
| High | Medium | Low | High | High | Medium |
I am trying to create a stacked bar chart, where the x axis has each column, a, b, c etc. as each bar, and with the y axis as a count of the occurrence/frequency of high, medium, and low per column, with high, medium, and low split within each single bar/column (3 stacks per bar).
I can use the following code to produce a new dataframe for the count of occurrences in a single column and then plot that in a bar chart, but I'm struggling to combine this into a single stacked bar, then repeat for all the columns.
library(dplyr)
newdf = df %>% dplyr::count(a)
Ideally this would also be a horizontal chart but I can figure that out later.

