From the course: Learning the R Tidyverse
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Categorizing data with group_by - R Tutorial
From the course: Learning the R Tidyverse
Categorizing data with group_by
- [Instructor] Dplyer is a member of the tidyverse ecosystem and designed for manipulating data with a variety of different verbs. The group by verb allows data to be categorized into a hierarchy of groups. For instance, data could be grouped by continent, country, and then city. Dplyr operations like filtering, sampling, or calculating values using mutate can be done within these groups. It's important to note that groups are a special feature of the tidyverse's version of a data frame, the tibble. For most intents and purposes, we call tibbles data frames. But I thoroughly recommend you understand the relationship between tibbles and data frames if you're going to be a hardcore user of group by and dplyr. Let's look at some examples of using group by inside of our studio. So, inside of our project, we have a file called data dash processing, which is where we'll be working. So let's open that up. And at the top of the file, we load the tidyverse, so we'll run that code with command…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Sample data and cross-validation with dplyr4m 8s
-
(Locked)
Categorizing data with group_by7m 7s
-
(Locked)
Count members of subgroups within groups with n()3m 51s
-
(Locked)
Cumulative sums and more: cumsum, cumall, and cumany11m 52s
-
(Locked)
Create group summaries7m 26s
-
(Locked)
Remember to ungroup before moving on7m 44s
-
(Locked)
-
-
-