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",          = 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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.