It just occured to me that you might be describing a grouped, rather than a stacked barplot. You can see examples of both with code here:
https://www.r-graph-gallery.com/211-basic-grouped-or-stacked-barplot/
It just occured to me that you might be describing a grouped, rather than a stacked barplot. You can see examples of both with code here:
https://www.r-graph-gallery.com/211-basic-grouped-or-stacked-barplot/