Removing per-panel unused factors in a bar chart with nested factors
问题 Some time ago I asked a question on how to remove unused factors in a bar chart, and I got a useful solution for that problem, thanks to @Aaron. Now, I am facing a very similar problem, but the solution that I used in the past does not work for this case. This is the code to reproduce the data frame that I am using: set.seed(17) df <- data.frame(BENCH = sprintf('bench-%s', sort(rep(letters[1:8], 4))), CLASS.CFG = sprintf('class-%s', c(rep('C', 4), rep('A', 4), rep('B', 8), rep('C', 8), rep('A