Multi-Panel Plots in R (using ggplot2)

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.ค. 2024
  • Hi everyone, this video discusses how to create multi-panel plots in ggplot2 as well as combine multiple plots into one figure using ggarrange. There is also a bonus section at the end addressing a question in the comments, which explains how to create a graph with more than one trend line and a matching numbers of legends. Please find the timestamps listed below:
    0:00 - Introduction
    0:09 - Mult-Panel Plots (Facet_grid() and Facet_wrap())
    5:55 - Multiple Plots in one Figure (ggarrange() from package ggpubr)
    9:31 - BONUS - Addressing TH-cam commnet about including multiple trend lines and legends in one graph including R^2 coefficient.

ความคิดเห็น • 24

  • @richardkamwezi9297
    @richardkamwezi9297 3 ปีที่แล้ว +13

    Helpful video. One thing that sort of confused me was that I initially thought that the ggarrange() function was part of ggplot2 when it rather is a function of the ggpubr package. It is my first time hearing about that package and I know that may be the case with others who come to this video.
    Thanks for sharing this.

    • @peelingbackdata3907
      @peelingbackdata3907  3 ปีที่แล้ว +1

      Hey thank you so much for pointing this out! I will try to update it so that it’s clear that you need to have the ggpubr package installed.

    • @somy30
      @somy30 2 ปีที่แล้ว +1

      Thanks for pointing this out!

  • @hoanggiahuy7589
    @hoanggiahuy7589 2 ปีที่แล้ว +1

    Thank you for sharing this! That helps me a lot in creating beautiful graphs for my project. Keep up the great work!

  • @pandabareO_o
    @pandabareO_o 10 หลายเดือนก่อน +1

    this was so easy to follow, I wish you were my lecturer gg
    I rate this 9/10 bananas

  • @buffaloperformanceandanaly1431
    @buffaloperformanceandanaly1431 ปีที่แล้ว

    Great video! Very easy to understand and follow. Thanks for sharing!

  • @Andrebuenogama
    @Andrebuenogama 3 ปีที่แล้ว

    Awesome, thank you!

  • @shohnazarhazratqulov6731
    @shohnazarhazratqulov6731 3 ปีที่แล้ว

    Thank you so much for the video! It really helped me!

  • @mocabeentrill
    @mocabeentrill ปีที่แล้ว

    Top shelf stuff!

  • @ditebayu7248
    @ditebayu7248 3 ปีที่แล้ว

    This is so useful thanks

  • @lucastheodori7370
    @lucastheodori7370 2 ปีที่แล้ว

    Thank you for nice lab,

  • @klews7867
    @klews7867 9 หลายเดือนก่อน

    thank you!

  • @ahmed007Jaber
    @ahmed007Jaber 2 ปีที่แล้ว

    thank you for this. what if I have more than 100 products and want to visualise their sales to pick on any apparent trend???

  • @mamonasadaf3437
    @mamonasadaf3437 3 ปีที่แล้ว

    Hi, this is amazing video. I tried and successfully made initial graph. I am unable to relate If we have time steps values .. I mean How can we make panel data graphs following the same steps? I have data for 1000 time steps values of 150 agents. As total of 150 (small, medium and large )farmers with distance from water source use surface water over the period of 1000 steps. How to see effect of time in it? Please guide!

  • @septiaanrml
    @septiaanrml 3 ปีที่แล้ว

    Hi, nice vid! But I’m still a bit confused on the subsetting the diamonds data.... what is it used for?

    • @peelingbackdata3907
      @peelingbackdata3907  3 ปีที่แล้ว +2

      Hi, glad you enjoyed the video! I just decided to subset the diamonds data so that it was easier to work with and demonstrate these techniques. When there are less data points the plots load much quicker, and seeing some of the trends is a bit easier I find. On a real-world dataset I wouldn’t recommend subsetting it unless you had a good reason to.

  • @takelezike7061
    @takelezike7061 2 ปีที่แล้ว

    Interesting video! can I get the syntax?

  • @aislinncitlaliperezmorales9907
    @aislinncitlaliperezmorales9907 ปีที่แล้ว

    tengo que instalar el paquete ggarrange? me dice que no encuentra la función con ggplot2

  • @bhavyagudhka7259
    @bhavyagudhka7259 ปีที่แล้ว

    how to use ggarrange in a for loop

  • @sergiomaia3029
    @sergiomaia3029 3 ปีที่แล้ว

    Can we get the code? Thanks much!

  • @leonardofwink
    @leonardofwink ปีที่แล้ว

    nossa, muito dificil de entender o código.. se tivesse separado por argumento seria mais fácil.. claro que o código funciona assim, mas não é facilmente lido por nós humanos

  • @dani08sv
    @dani08sv 2 ปีที่แล้ว +2

    Nothing is working, ggarrange() is not even a function in the ggplo2 package, you need to install ggpubr, and even then you still cant use ggarrage(). And what about multi panel plot 2 plots of any type? not just ggplots, this is not usefull, and you dont even explain what the functions do.

    • @bepppi
      @bepppi ปีที่แล้ว

      Yeah read a book buddy