Book Image

Mastering Data analysis with R

By : Gergely Daróczi
Book Image

Mastering Data analysis with R

By: Gergely Daróczi

Overview of this book

Table of Contents (19 chapters)
Mastering Data Analysis with R
Credits
www.PacktPub.com
Preface

Summary functions


As we have discussed earlier, all aggregating functions can take any valid R functions to apply on the subsets of the data. Some of the R packages make it extremely easy for the users, while a few functions do require you to fully understand the package concept, custom syntax, and options to get the most out of the high-performance opportunities.

For such more advanced topics, please see Chapter 4, Restructuring Data, and the further readings listed in the References section at the end of the book.

Now, we will concentrate on a very simple summary function, which is extremely common in any general data analysis project: counting the number of cases per group. This quick example will also highlight some of the differences among the referenced alternatives mentioned in this chapter.

Adding up the number of cases in subgroups

Let's focus on plyr, dplyr and data.table now, as I am pretty sure that you can construct the aggregate and tapply versions without any serious issues....