From the course: R for Data Science: Analysis and Visualization
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Piping commands with | - R Tutorial
From the course: R for Data Science: Analysis and Visualization
Piping commands with |
- [Instructor] Sometimes code can be difficult and this can be as true for R as for anything else. And one of the places where this is most apparent is with nested commands. So for example, here's a command I used once for some analysis, and the important thing is that in Base R, it starts in the middle and then goes out. So for instance, right here it says use the data from UCBAdmissions. That's a dataset in the R datasets package. Then I apply a function called margin.table to it. And then I have an argument a couple steps over that says use table or margin three. Alright, so we apply that to UCBAdmissions but then I want to do something to that. I convert it to a proportion table and then I want to round it to two decimal places. And you can see, those are really, really far apart from each other. And then finally, I take the whole thing and multiply it times a hundred to get it so it's like percentages. This is a…
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
-
-
-
-
Installing R3m 30s
-
(Locked)
Environments for R2m 54s
-
(Locked)
Installing RStudio1m 9s
-
(Locked)
Navigating the RStudio environment8m 17s
-
(Locked)
Entering data7m 2s
-
(Locked)
Data types and structures10m 35s
-
(Locked)
Comments and headers5m 59s
-
(Locked)
Packages for R4m 18s
-
(Locked)
The tidyverse5m 38s
-
(Locked)
Piping commands with |4m 42s
-
(Locked)
Sample datasets4m 35s
-
(Locked)
Importing data from a spreadsheet5m 24s
-
-
-
-
-