ggplot2 is probably the best option to build grouped and stacked barchart. The input data frame requires to have 2 categorical variables that will be passed to the
fill arguments of the
aes() function. Toggling from grouped to stacked is pretty easy thanks to the
Basic Stacked barplot
Instead of having subgroups one beside another, they are on top of each other.
A parcent stacked barchart with R and ggplot2: each bar goes to 1, and show the proportion of each subgroup.
A stacked area chart showing the evolution of a few baby names in the US. Zoom on a specific time frame through brushing. Highlight a specific group by hovering the legend. Double click to unzoom.