From the course: Learning the R Tidyverse
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Remember to ungroup before moving on - R Tutorial
From the course: Learning the R Tidyverse
Remember to ungroup before moving on
- [Instructor] Groups are an incredibly powerful feature of the tidyverse. They allow us to do a lot of different operations really neatly and succinctly. But it's really important to remember to get rid of groups when you're finished working with them. Let's look at a few examples of what we can do with groups and why it's important to ungroup when we're finished. Inside of our exercise files, we have a file called data-processing.R so let's open that up. We can see we have a number of different operations that we perform. At the top of the script file, we do whatever we do when we're working with the tidyverse, which is we load the library tidyverse. So if I hit command + enter, I've just decreased the size of the file view because I don't need to see it, we see that library tidyverse loads a standard set of libraries from the tidyverse. On line three, we use the function read_csv to import our data from the csv file and we assign it to the symbol transport_data. So let's run that…
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)
-
-
-