Skip to Content
Modern R Programming Cookbook
book

Modern R Programming Cookbook

by Jaynal Abedin
October 2017
Beginner to intermediate
236 pages
7h 38m
English
Packt Publishing
Content preview from Modern R Programming Cookbook

There's more…

In this recipe, you went through the implementation using the dplyr approach and the base R approach. Though the outputs are same, if you notice the column name of the output, there is a difference between the approaches. This is one of the limitations of using the aggregate function. It usually treats all columns under the same name irrespective of the name you define in the customized function. As a result, the column name comes with an x prefix, whereas in the dplyr approach, the column name comes as you defined it within the body of the code.

Moreover, the output of the dplyr approach looks cleaner compared to the base R approach.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

R Cookbook, 2nd Edition

R Cookbook, 2nd Edition

JD Long, Paul Teetor

Publisher Resources

ISBN: 9781787129054Supplemental Content