πŸ“Š R Programming
Q. How do you create a stacked bar plot in ggplot2 for two categorical variables category1 and category2?
  • (A) geom_bar(aes(x = category1, fill = category2), position = "stack")
  • (B) stacked_bar(category1, category2)
  • (C) geom_bar(mapping = aes(x = category1, fill = category2), stat = "stack")
  • (D) bar_plot_stack(category1, category2)
πŸ’¬ Discuss
βœ… Correct Answer: (A) geom_bar(aes(x = category1, fill = category2), position = "stack")

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
155
Total Visits
πŸ“½οΈ
2 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
95%
Success Rate