Q. How do you create a stacked bar plot in ggplot2 for two categorical variables category1 and category2?
β
Correct Answer: (A)
geom_bar(aes(x = category1, fill = category2), position = "stack")