I am looking for an elegant visualization of this mock dataset. My dataset a.dat
is the in the form of a csv.
Category,Treatment,Score
Red,Compact,1
Red,Expand,1
Blue,Neutral,2
Blue,Destroy,1
Green,Compact,4
Green,Expand,3
Red,Expand,2
Yellow,Neutral,3
Red,Destroy,5
Blue,Compact,2
Red,Compact,1
Yellow,Expand,3
Yellow,Expand,2
Yellow,Expand,3
Blue,Neutral,5
Blue,Destroy,2
Red,Compact,1
Green,Neutral,2
Blue,Destroy,4
Blue,Compact,3
Red,Expand,5
Yellow,Expand,2
Yellow,Expand,1
Yellow,Neutral,3
Blue,Destroy,2
Blue,Compact,3
Red,Expand,5
Blue,Expand,2
Blue,Neutral,1
Green,Destroy,2
Green,Compact,4
Red,Neutral,1
Yellow,Destroy,2
Yellow,Compact,1
I want the Categories of Red, Blue, Green, Yellow, to flow into the Treatment. Each Treatment also has a stacked barplot for the score-counts, i.e: the number of times a particular score was registered for each Treatment. Below is a (badly) hand-drawn expectation:
Please try and make the solution as tidyverse
friendly as possible.