I am trying to plot two different variables on the Y-axis vs one variable on the X-axis. I am using ggplot geom_bar for the same. However, the results are not coming in the way what I wanted. My data frame looks as below:
DAY_OF_WEEK CATEGORY_TOTAL OVERALL_TOTAL CAT_PERCENT OVERALL_PERCENT
1 FRIDAY 4893 30542 16 20
2 MONDAY 5198 31197 17 20
3 SATURDAY 133 1139 12 1
4 THURSDAY 4806 29641 16 19
5 TUESDAY 5184 31757 16 21
6 WEDNESDAY 4569 28090 16 18
ggplot(my_data_frame, aes(x=DAY_OF_WEEK,y=CATEGORY_TOTAL,fill=OVERALL_TOTAL)) +
geom_bar(stat="identity",position = "dodge")
I need DAY_OF_WEEK on the X-axis, and two bars next to each other for each day. One bar corresponding to CATEGORY_TOTAL and the other one for OVERALL_TOTAL. Similarly I want another plot for the percentages as well. However, with the above ggplot statement, I am only getting one bar i.e. CATEGORY_TOTAL.
Please suggest on how to achieve what I needed.
Thanks