ggplot2: geom_bar

Hello! I wanted to create a bar graph the same with the picture below. image . I have two sets of data. One is for the number of enrollment while the other one is for graduates for different disciplines. I have to depict in the graph the comparison of the enrollment and the number of graduates throughout the years.

Year  `Agricultural, ~ `Architectural ~ `Business Admin~ `Education and ~ `Engineering an~
  <chr>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>
1 2009~            59745            20491           723997           352343           339045
2 2010~            63471            23116           796302           404261           354321
3 2011~            68098            26356           845031           450225           367620
4 2012~            81740            31352           915191           536854           406831
5 2013~            96164            34698           970558           624254           424143
6 2014~           125526            39532           990676           725183           463221
7 2015~           143182            45583          1066639           791284           517010
8 2016~           127287            40238           921324           740713           448550
9 2017~           100922            33439           775805           639063           370710
# ... with 16 more variables: `Fine and Applied Arts` <dbl>, General <dbl>, `Home
#   Economics` <dbl>, Humanities <dbl>, `Information Technology` <dbl>, `Law and
#   Jurispundence` <dbl>, Maritime <dbl>, `Mass Communication and Documentation` <dbl>,
#   Mathematics <dbl>, `Medical and Allied` <dbl>, `Natural Science` <dbl>, `Other
#   Disciplines` <dbl>, `Religion and Theology` <dbl>, `Service Trades` <dbl>, `Social and
#   Behavioral Science` <dbl>, `Trade, Craft and Indutrial` <dbl>
> Graduates
# A tibble: 9 x 22
  Year  `Agricultural, ~ `Architectural ~ `Business Admin~ `Education and ~ `Engineering an~
  <chr>            <dbl>            <dbl>            <dbl>            <dbl>            <dbl>
1 2009~            10043             2274           117399            56419            49373
2 2010~             9618             2245           125840            62715            57439
3 2011~            11605             2278           141327            69738            56690
4 2012~            13796             2624           164541            86903            59399
5 2013~            13986             2849           169846            98277            63539
6 2014~            16906             3718           185358           110320            70646
7 2015~            21209             3951           185858           118567            76423
8 2016~            24210             4828           202895           138496            82794
9 2017~            26773             5900           207178           162900            86860
# ... with 16 more variables: `Fine and Applied Arts` <dbl>, General <dbl>, `Home
#   Economics` <dbl>, Humanities <dbl>, `Information Technology` <dbl>, `Law and
#   Jurispundence` <dbl>, Maritime <dbl>, `Mass Communication and Documentation` <dbl>,
#   Mathematics <dbl>, `Medical and Allied` <dbl>, `Natural Science` <dbl>, `Other
#   Disciplines` <dbl>, `Religion and Theology` <dbl>, `Service Trades` <dbl>, `Social and
#   Behavioral Science` <dbl>, `Trade, Craft and Indutrial` <dbl>

Anyone who can help? Thanks!

This is called a grouped bar chart, and there's code at the link below for how to make them.


More examples here:
http://www.cookbook-r.com/Graphs/Bar_and_line_graphs_(ggplot2)/

1 Like

Thanks, Mara. I will make sure to check on this.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.