Multi-Layer Stacked Bar Chart in R

I am trying to get something like below. Can anyone give me pointers how I can do that ?

Also the height of the bar is the count of records by unique group