How to do it...

Let's take a look at the following steps and learn how to use the summarise() verb to summarize the dataset:

  1. In the first step, import the dataset into the R environment as follows:
        USAairlineData2016 <- read.csv("USAairlineData2016.csv", as.is          = T)
  1. Now, we will take a look at the following four scenarios that depict all the operations mentioned in the beginning of this recipe:
  • One operation on one variable: The summarise() verb will take the input of a single variable and produce a single-valued output. In the following example, it takes the DEP_DELAY variable as an input and produces mean delay as an output:
            meanDelay <- USAairlineData2016 %>%             select(ORIGIN, DEST, DEP_DELAY) %>%             group_by(ORIGIN,DEST) %>% summarise(meanDelay ...

Get Modern R Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.