May 2019
Beginner to intermediate
266 pages
5h 57m
English
The group_by() function is used to group data together based on one or more columns. It works in a similar fashion to the GROUP BY clause of Structured Query Language (SQL).
Consider that we need to create a dataset that groups the columns according to model names. This can be achieved using the group_by() function, as follows:
> mpgGroupBy <- mpg %>%group_by(model) > View(mpgGroupBy)
We get the following output:

Read now
Unlock full access