From the course: R Essential Training: Wrangling and Visualizing Data

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Piping commands with %>%

Piping commands with %>%

From the course: R Essential Training: Wrangling and Visualizing Data

Start my 1-month free trial

Piping commands with %>%

- [Instructor] I want to finish our setup by talking about how you can pipe commands in R using this funny little series of characters, the percent signs with the greater than symbol in the middle, known as the piping character, which is included as part as the Tidyverse. Now, there's a reason that I need to cover this one separately and it's because it dramatically changes the way you write code. But I think this is in good ways. Let me give you an example of command and how you would write it in base R. Base R uses nested commands, which mean you start in the middle and you go out. So say for instance, here's a command that I actually have used. It's about taking data from a dataset called UCBAdmissions and then eventually turning it into a table with percentages. Well, the very first thing that we start with is the data, that's UCBAdmissions, that's here in the middle. But then what I want is I want to get what's margin…

Contents