Today I would like to present pipe operator which simplify our code and makes it more readable. As we can see all of the dplyr functions take a data frame (or tibble) as the first argument. Dplyr provides the %>% operator from magrittr that chains the functions so x %>% f(y) turns into f(x, y). Therefore the result from one step is then “piped” into the next step. We will use pipe operator in further examples. Additionally we will focus on grouping, ordering and summarising functions. As previously I will continue using mtcars dataset which is included in your R base program. count() #count the unique values of one or more variables n() n_distinct() #number of unique observation found in a category group_by() # group by a column, allows to group operation in the “split-apply-combine" concept library(dplyr) data("mtcars") head(mtcars) mpg cyl disp hp drat...
Hello everybody and welcome to my blog where I would like to share with you my learning journey through the data science. My name is Karolina. I am a polish girl living in France. I have master's degree in applied mathematics and few years of work experience in business and banking filed.