How it works…

After importing the data into the R environment, the code works as follows:

  1. It takes the entire dataset as an input in the first place. It will work as the input for the function select().
  2. Within the select() function, it only keeps the variables of month and departure delay.
  3. The filter() function takes the output from the select() function and drops those rows that have negative values in the DEP_DELAY variable.

 

  1. The group_by function instructs the summarize() function that the calculation should be grouped by the variable specified into the group_by section.
  2. The summarize() function then calculates the mean departure delay for each month and supplies the output data to the plotting function qplot().
  3. The qplot() function produces a line plot of mean delay of departure for each month, and then, the add() function performs some formatting types of task, such as adding axis title and plot title, and finally, it applies the black-and-white theme.
  4. The print() function, finally, produces the output into the R plotting device as follows:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset