How to Create Diverging Bar Charts With {ggplot2} | Step-by-Step Tutorial

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024
  • DESCRIPTION AND CODE
    In this video we create a diverging bar chart with {ggplot2}. And we create not just any diverging bar chart, we recreate a pretty elaborate chart from the PEW Research Center. The full code for this can be found on my blog at albert-rapp.de...
    📈 CREATE EFFECTIVE CHARTS
    Check out my video course to create insightful data visualizations with ggplot at arapp.thinkifi...
    MORE VIDEOS
    📺 Avoid duplicate R code in 150 seconds • Avoid duplicate code w...
    📺 Shiny modules in 100 seconds • Shiny Modules in 100 S...
    📺 Fast explainer playlist • Explainer videos
    Subscribe at 👉 / @rappa753
    MORE CONTENT
    - weekly 3-minute newsletter about R, DataViz and webdev at 3mw.albert-rap...
    - LinkedIn at / albert-rapp-9a5b9b28b
    #rstats #dataviz #ggplot #dplyr

Комментарии • 22

  • @rappa753
    @rappa753  6 месяцев назад +1

    Enjoyed this video? Then you're definitely going to enjoi my video course. Lots more of detatiled tutorials on complex chart. Check it out at arapp.thinkific.com/courses/insightful-data-visualizations-for-uncreative-r-users

  • @MannISNOR
    @MannISNOR 6 месяцев назад +2

    Absolutely amazing! 🤯 It's inspiring to see you tackle such an advanced visualization. I also really appreciate the way you present the code and procedures you use. 👏

    • @rappa753
      @rappa753  6 месяцев назад +1

      Thank you! 🥳 I'm really glad to hear this. Making videos on such complex chats is always way more work than short into videos. So I'm really glad this work is appreciated 🤗

  • @flonga2302
    @flonga2302 6 месяцев назад +1

    Wow, thank you for showing how to these amazingly complex ggplots.

    • @rappa753
      @rappa753  6 месяцев назад

      You're very welcome 🤗

  • @m31uk3
    @m31uk3 5 месяцев назад +1

    This is like watching the crafting of a fine timepiece!!! I was literally screaming at the screen so many times when you would show a slick trick to problems I’ve also spent countless hours searching for elegant solutions to. 😊

    • @rappa753
      @rappa753  5 месяцев назад

      Awesome! Happy to hear that you found some thrilling moments in this video ☺✨

  • @MKhan-zo8xo
    @MKhan-zo8xo 6 месяцев назад +1

    very very cool chart for a unique use case, impressive!!

    • @rappa753
      @rappa753  6 месяцев назад +1

      Glad that you liked it. Diverging bar charts are really great for these opinion-polls kind of situations :)

  • @zemariununes
    @zemariununes 6 месяцев назад +2

    I loved it. Thanks for this post. 👏🏽

    • @rappa753
      @rappa753  6 месяцев назад

      Nice! This video is a bit of a really complicated one. So I'm glad that it's appreciated :)

  • @weitzun9691
    @weitzun9691 6 месяцев назад +1

    I really like your channel !

    • @rappa753
      @rappa753  6 месяцев назад

      Thank you 🤗 nice to be appreciated 🥳

  • @max_tennis
    @max_tennis 6 месяцев назад +1

    Great video, as usual. Thank's Albert.

    • @rappa753
      @rappa753  6 месяцев назад

      Thank you Max 🤗

  • @munenedenis3377
    @munenedenis3377 6 месяцев назад +1

    Awesome

    • @rappa753
      @rappa753  6 месяцев назад

      Thank you 🤗

  • @arunstartupgur
    @arunstartupgur 6 месяцев назад +1

    Love it, Albert

  • @quanguc4806
    @quanguc4806 Месяц назад +1

    Hey Albet. Your figures are great. Could you help me fix the last step? When I run the code in the section "Assemble the charts," the result shows "There were 50 or more warnings (use warnings() to see the first 50)," and the plot is fading. It only displays the chart's frame without any details. Please help me.

    • @rappa753
      @rappa753  Месяц назад

      Did you run the warnings() command in R to see the warnings? That might give us an indication of what goes wrong. In the absence of that, just taking a guess: maybe you can profit from using the {ragg} graphics device? Just look for that R package and follow the instructions to enable that device in RStudio

  • @jamesfoster1441
    @jamesfoster1441 5 месяцев назад

    Hi Albert,
    Thanks for the great tutorial. I am trying to replicate this chart with some survey data; however, I need help with the computed values.
    In your blog, you state, “We have the preference column already in the natural order of “Strongly oppose,” “Somewhat oppose,” “Somewhat favor” and “Strongly favor.”” Therefore, you don’t need to sort. How would you sort the Likert items if they weren’t in their natural order? I tried using Factor and Leveling, but it’s not working.
    Lastly, could you assist me with duplicating this method for several more survey questions?

    • @rappa753
      @rappa753  5 месяцев назад

      Hi James, in the video calculating the coordinates worked because the rows of the tibble are already in the desired order (groupwise). To make that happen if this is not the case, make the column into a factor variable with the `factor()` function where you use the `levels` argument to set the order that you need. Afterwards you can use the `arrange()` function to sort the rows of the tibble according to the levels of the new factor column. Does this work for you?