Stylizing the appearance of facet labels with ggplot2's facet_wrap (CC236)

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ค. 2024
  • How do you change the appearance of facet labels in the ggplot2 R package? In this episode of Code Club, Pat shows you how to change the location, appearance, and labels within facet labels when using ggplot2's facet_wrap function. He'll also show how you can alter the order of the facets in your figure. The overall goal is to show the amount and probability of precipitation throughout the year using NOAA data from his local weather station
    You can find my blog post for this episode at www.riffomonas.org/code_club/....
    #ggplot2 #dplyr #R #Rstudio #Rstats
    Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at shop.riffomonas.org/youtube to get practice problems, tips, and insights.
    If you're interested in taking an upcoming 3 day R workshop be sure to check out our schedule at riffomonas.org/workshops/
    You can also find complete tutorials for learning R with the tidyverse using...
    Microbial ecology data: www.riffomonas.org/minimalR/
    General data: www.riffomonas.org/generalR/
    0:00 Introduction
    1:45 Calculating probabilities and quantities of precipitation
    7:53 Generating faceted plot
    12:43 Constructing y-axis titles
    16:51 Improving appearance of figure
    19:18 Adding annotation to indicate today
  • วิทยาศาสตร์และเทคโนโลยี

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

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

    True to form, it's been super dry the last few weeks and then last night we got an inch of rain - 25 mm!

  • @NATS7599
    @NATS7599 ปีที่แล้ว +5

    Mean(prcp > 0) 🤯…I learn something new in everyone one of your videos!

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

      🤓love it! Thanks for watching

  • @JJ0145
    @JJ0145 29 วันที่ผ่านมา

    Fantastic video!! Please do more of these types of videos

    • @Riffomonas
      @Riffomonas  29 วันที่ผ่านมา

      I'll see about circling back to data viz types of videos. I've made a bunch of them and am not sure what I might have missed 😂

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

    I really like your videos. They have helped me a lot. Thanks

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

    Listening to you describe what you are doing and why teaches me so much more than looking at at someone's finalized code. I learn something valuable each time you make a video. I'm struggling updating one dataframe with a partial set of updated values of the same columns from another dataframe. I get errors if there are some index values in one dataframe but not in the other, or if there are NA values. I haven't found the right combination of functions to achieve a good merge of MY data.

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

      Thanks! I guess I’d suggest trying to whittle things down to a minimal example that shows your problem and then try to solve it. In these situations I usually find just the process of simplifying things helps me to think through what’s wrong and what I need to do

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

      @@Riffomonas This was how I finally did it. fixed % left_join(df2, by = c('INDEX'), suffix = c('', '.y')) %>% mutate(Lat_AND_Long = coalesce(Lat_AND_Long, Lat_AND_Long.y)) %>% mutate(Latitude = coalesce(Latitude,Latitude.y)) %>% mutate(Longitude = coalesce(Longitude,Longitude.y)) %>% mutate(Website = coalesce(Website,Website.y)) %>% select(-c(Lat_AND_Long.y)) %>% select(-c(Latitude.y)) %>% select(-c(Longitude.y)) %>% select(-c(Website.y))

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

    Fantastic tutorial!

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

      Thanks! Glad you enjoyed the video🤓

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

    Nice! I prefer to go with a theme instead of tinkering too much. The "tufte" theme from the ggthemes package is nice and minimalist. To each its own!

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

    Great examples! Would anyone know how one would you put red vertical lines at different x-intercept positions for each facet?

  • @ikrambashir8604
    @ikrambashir8604 8 หลายเดือนก่อน

    Hi, thanks for the video. How can I add symbols to the individual strip title of facrt_wrap ?

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

    Great as usual. May I ask you to let me know, how I can get the code script?

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

      Thanks for watching! If you go to the link in the description to the episodes blogpost you’ll find the GitHub repository before and after the episode

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

      @@Riffomonas Excellent. Thanks a lot for you. 👌

  • @liutrvcyrsui
    @liutrvcyrsui 3 หลายเดือนก่อน

    +1