Using the following code, I can create a simple stacked barplot that has a rightangular shape:
barplot(as.matrix(prop.table(c(150,90,60))),col=c('Cornflowerblue','Yellow','Red'),las=1)
The output looks like this
However, I want to build a barplot that is a pyramid, such that the breakdown of percentages is by its area not by its length. Since the tip of the pyramid has much smaller area than the bottom, the corresponding pyramid plot should look something like this
I'm just not sure how to code such a plot in R. Any suggestion would be appreciated.