MENU

Fun & Interesting

Using dplyr's group_by function with and without summarize (CC233)

Riffomonas Project 5,630 lượt xem 2 years ago
Video Not Working? Fix It Now

Did you know you can use dplyr's group_by function without summarize? This is a powerful tool that we'll use to normalize monthly average temperatures to the monthly averages between 1951 and 1980. Along the way we'll see some cool date functions like today, year, and month from the lubridate package and we'll plot the data with geom_line using the ggplot2 package. We'll do everything within RStudio.

You can find my blog post for this episode at https://www.riffomonas.org/code_club/2022-07-25-group_by.

#ggplot2 #dplyr #R #Rstudio #Rstats

Want more practice on the concepts covered in Code Club? You can sign up for my weekly newsletter at https://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 https://riffomonas.org/workshops/

You can also find complete tutorials for learning R with the tidyverse using...
Microbial ecology data: https://www.riffomonas.org/minimalR/
General data: https://www.riffomonas.org/generalR/

0:00 Introduction
1:04 Repurposing a script to automate data retrieval and clean up
4:10 Using group_by with summarize
7:26 Normalizing temperatures to a range of years
11:23 Using group_by with summarize for two variables
15:02 Using group_by without summarize to normalize by month
18:22 Plotting and interpreting results
22:45 How does this year compare to 1951-1980?

Comment