dplyr: Pipes
The pipe operator %>% is a special symbol available after you load the dplyr package that lets you use the result of one function as the input to another function that comes after the pipe. Pipes essentially let you chain several functions together, creating a flow or pipeline of operations.
Link to the Kaggle Notebook code used for this video series:
https://www.kaggle.com/hamelg/dplyr-in-r
View the whole dplyr in R playlist here:
https://www.youtube.com/watch?v=THGFXV4RW8U&list=PLiC1doDIe9rC8RgWPAWqDETE-VbKOWfWl
dplyr cheat sheet from RStudio:
https://www.rstudio.com/wp-content/uploads/2015/02/data-wrangling-cheatsheet.pdf
dplyr documentation:
https://cran.r-project.org/web/packages/dplyr/dplyr.pdf
Follow DataDaft on social media for news and updates:
Twitter: https://twitter.com/DataDaft
Join the DataDaft Discord to discuss all things data science:
https://discord.gg/ZS2yPNw
* Note for the pipe symbol above, I used the special character large greater than ">" instead of the standard greater than symbol because YouTube does not allow the normal symbol in the text description.
** Note: in the video you may notice a warning message when running the root mean squared error calculations. This happened because the vectors of dummy data weren't the same length! When performing math operations with vectors of unequal length, R will wrap back around to the beginning of the shorter vector as many times as necessary to match the length of the longer vector, which is why we still get a result (and only a warning instead of an error.).
#dplyr #rprogramming #datascience
Other Videos By DataDaft
| 2019-10-07 | dplyr: Joins |
| 2019-10-06 | dplyr: Grouping |
| 2019-10-05 | dplyr: summarize |
| 2019-10-03 | MLB All-Time Team Records: Most Home Runs Hit in a Season (1871-2019) |
| 2019-09-30 | dplyr: gather and spread |
| 2019-09-28 | dplyr: separate and unite |
| 2019-09-27 | dplyr: mutate |
| 2019-09-25 | dlpyr: rename and arrange |
| 2019-09-24 | dplyr: select |
| 2019-09-17 | dplyr: filter |
| 2019-09-13 | dplyr: Pipes |
| 2019-09-13 | dplyr: Getting Started |
| 2019-09-11 | Introduction to R: Descriptive Statistics |
| 2019-09-06 | How to Read csv Data Into R |
| 2019-09-05 | Introduction to R: Plotting with ggplot2 |
| 2019-09-04 | How To Use ifelse in R |
| 2019-09-03 | Introduction to R: Plotting in Base R |
| 2019-08-28 | Introduction to R: Frequency Tables |
| 2019-08-27 | Introduction to R: Merging Data |
| 2019-08-23 | Introduction to R: Dealing With Dates |
| 2019-08-21 | Introduction to R: Preparing Numeric Data |

