---
layout: post
title: "Using dplyr's group_by for grouping data in R (CC163)"
blurb: "Using group_by without summarize"
author: "PD Schloss"
date: 2021-11-15 11:00
comments: false
youtube: ZOSMcPOuv6M
start_hash: 0bed39115831c015e5158abed17d5867949af933
end_hash: 9465d9a42a5666756ce18d8d648bbb03c880f0ad
---

In this episode of Code Club, Pat uses `dplyr`'s `group_by` function for grouping data in R without using the summarize function. Instead he uses `slice_max` to return the row or rows for each group that has the most recent date. He'll demonstrate how to use these functions with a massive data frame that we downloaded from Our World in Data that describes COVID-19 vaccination rates by country and day.

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>


## Code

You can browse the state of the repository at the
* [beginning of the episode](https://github.com/riffomonas/vaccination_attitudes/tree/{{ page.start_hash }})
* [end of the episode](https://github.com/riffomonas/vaccination_attitudes/tree/{{ page.end_hash }})
