How to add significance lines and stars to a faceted figure in R with ggplot2 (CC095)

Поділитися
Вставка
  • Опубліковано 11 гру 2024

КОМЕНТАРІ • 26

  • @Riffomonas
    @Riffomonas  3 роки тому +1

    One thing that I would change about this figure is that the y-axis title is a bit small. See if you can figure out how to increase the size of that text! Remember... it isn't really the y-axis title :)

  • @anitavoigt5609
    @anitavoigt5609 3 роки тому +1

    Hello from Connecticut! I love your videos and shared your channel with my friends in the microbiome field. Keep up the good spirit. You make working in R fun.

    • @Riffomonas
      @Riffomonas  3 роки тому

      Hey Anita - thank you so much! There's a lot of awesome science happening in Connecticut :)

  • @linaalasfar5469
    @linaalasfar5469 2 місяці тому +1

    You could use ggpubr for adding the significance level of a stat test

    • @Riffomonas
      @Riffomonas  2 місяці тому

      Yeah, but that would be another package to learn :)

  • @imeneker9320
    @imeneker9320 3 роки тому +1

    Big fan from Algeria 😍

    • @Riffomonas
      @Riffomonas  3 роки тому +1

      Wonderful - thanks for watching!!!

  • @berangerevillatte6710
    @berangerevillatte6710 2 роки тому +1

    Thank you for this! How could the "lines" variable be adjusted for a multifacet plot (say 3-by-3) ?

    • @Riffomonas
      @Riffomonas  2 роки тому

      It should be able to generalize from what I currently had it as. For 3x3 you'd need to add 6 more metrics (or whatever you want to call them) along with the relevant x, xend,y, and yend values. I touched on how to automate this in ua-cam.com/video/-DfCitMqdUc/v-deo.html

  • @KN-tx7sd
    @KN-tx7sd 3 роки тому +1

    Hi Pat, once again really appreciate for the video, exactly the same what I was looking for. I also found this package ggpubr and the function stat_compare_means doing nearly similar to what you have explained. May I know if you think its nearly the same as I found we can also facet and the package could add the astericks and lines without doing it manually. Also under the method sections there is a full suite of tests such as ANOVA, t-test etc. thank you

    • @Riffomonas
      @Riffomonas  3 роки тому +1

      I’ve never used that package. For these videos I really want to stick to the basics of how to use the tidyverse. All the other packages are great but you have to memorize how to use them rather than learn concepts that are more broadly applicable

    • @KN-tx7sd
      @KN-tx7sd 3 роки тому

      @@Riffomonas thanks, Pat

  • @christineschneider3655
    @christineschneider3655 3 роки тому +1

    I just tried it and it worked! :) Very exiting. I like the way you explain all this coding stuff in your videos.
    Thank you so much for the fast help. All the best from Germany.

    • @Riffomonas
      @Riffomonas  3 роки тому

      Wonderful! So glad it worked and was helpful 🥳

  • @AnkeetKumar
    @AnkeetKumar Рік тому

    You are amazing..

  • @md.masumbillah8222
    @md.masumbillah8222 2 роки тому +1

    Hi , I wonder do you have any tutorial about how to add compact letter display on the bar/box plot ?

    • @Riffomonas
      @Riffomonas  2 роки тому +1

      Thanks for the question! I don’t but it should be the same approach I used here. You’d have to replace the stars with the letter combinations that make the most sense

  • @matheusalmeida773
    @matheusalmeida773 Рік тому

    Hello Pat, this video is amazing!
    I'm working and learning R day by day. Currently, I'm analyzing some results. I have three groups and around 10 markers so I'm using face_wrap to see all these markers together. Some of them have significance and others don't. Do you know how can I put the markers in order of significance ? Hope you can help me!! Congratulations again for the video!

    • @cristianjaviermena6955
      @cristianjaviermena6955 Рік тому

      Matheu! if i understood correctly your question and what Pat says at other video, he explains that a result is either significant or not significant, you might just orderer them by this. and you can do this just by useing pivot longer to your markers ( pivot_longer(cols = c(marker1,marker2, marker3, marker4), names_to = "markers", values_to = "value") and then ordering them in the "factor line" :
      .....%>%
      mutate (markers= factor(markers , levels = c("marker2","marker3","marker1", "marker4")))
      where markers 2 and 3 are significant and 1 and 4 not significant.
      im also pretty new at R. this may not be useful or correct!

  • @owenhovey
    @owenhovey 2 роки тому +1

    Why use geom_segment, geom_line geom_text over ggsignif package?

    • @Riffomonas
      @Riffomonas  2 роки тому

      Because it gives me an opportunity to teach how to use these geoms. Also the cognitive overhead of having to remember how to use another package for a pretty niche application is more than I can do sometimes

  • @samihahzura4735
    @samihahzura4735 3 роки тому +1

    Hi, my R mentioned that there is no 'tibble' function. Can you help?

    • @Riffomonas
      @Riffomonas  3 роки тому +1

      Try running library(tidyverse) first

    • @samihahzura4735
      @samihahzura4735 3 роки тому

      @@Riffomonas it works, thanks!

  • @mateovinuezaguarderas9646
    @mateovinuezaguarderas9646 2 роки тому +1

    Noice