From the course: Learning the R Tidyverse
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
Grouping and summarizing data by column or row - R Tutorial
From the course: Learning the R Tidyverse
Grouping and summarizing data by column or row
- [Instructor] Grouping and summarizing data are closely related activities, particularly in a tidyverse. We'll get extremely different summaries and groupings when we switch between grouping our data by row or column. To compare the differences between column and row grouping, I'm going to use two data sets in this course, the "Star Wars" dataset and a tibble containing exam results for several students. Our "Star Wars" data is in long format. Any kind of summary that we'd want to make would be column-wise. For instance, we might want to count the total number of characters by home world, or we might want the height of the tallest character from each home world, or potentially from each combination of home world and species. Column-wise grouping is the most common type of grouping that you'll use with your data, and it's for default. But sometimes we care about row-wise grouping. Our exams data has been stored in a slightly wide format, which can be really useful. By grouping the…
Contents
-
-
-
-
-
-
(Locked)
Grouping and summarizing data by column or row2m 22s
-
(Locked)
Cross tabulations with count()3m 21s
-
(Locked)
Column-wise groups: group_by() and mutate()3m 38s
-
(Locked)
Column-wise groups: group_by() and summarize()3m 10s
-
(Locked)
Column-wise groups: group_by() and reframe()3m 8s
-
(Locked)
Column-wise groups: Using the .by argument instead of group_by()2m 40s
-
(Locked)
Row-wise groups: rowwise() and c_across()4m 12s
-
(Locked)
Remember to ungroup()1m 50s
-
(Locked)
Challenge: Find maximum penguin dimension by island1m 3s
-
(Locked)
Solution: Find maximum penguin dimension by island3m 40s
-
(Locked)
-
-
-