1

How do you create a stacked bar plot in ggplot2 for two categorical variables category1 and category2?

Correct Answer: geom_bar(aes(x = category1, fill = category2), position = "stack")

Make the most of this question

This page focuses on one R Programming MCQs question from Programming. After checking the answer, return to the topic list to practice more or run a timed set.

R Programming MCQs MCQ: How do you create a stacked bar plot in ggplot2 for two categorical variables category1 and category2? | Extra Education