I'm new to R programming as well as on Stackoverflow. I am trying to create a group bar chart (position = dodge) for two variables on y-axis and Region names on x-axis. Here is the data:
TeenTotal SrTotal Region
1 1882 703 North Eastern
2 2277 1028 North Central
3 1647 627 Southern
4 2299 727 Western
The below code is working, but for only one column (here, SrTotal):
ggplot(Chart2, aes(Region, SrTotal)) +
geom_bar(stat="identity", position = "dodge") +
scale_fill_brewer(palette = "Set1")
To get both columns, SrTotal & TeenTotal, I am trying this:
ggplot(Chart2, aes(Region, SrTotal)) +
ggplot(Chart2, aes(Region, TeenTotal)) +
geom_bar(stat="identity", position = "dodge") +
scale_fill_brewer(palette = "Set1")
How can I show SrTotal and TeenTotal on y-axis groupbars and Region on x-axis? Also, I would like to add data labels. How can this be done?