In the data pre-processing steps, sorting the rows based on a variable of interest is one of the most common tasks. The dplyr verb arrange() works in a very similar way to the base R sort() function, but it has more intuitive features than default sort(). In this recipe, you will use the verb arrange() to organize the rows of a data frame.
Using the arrange verb for data processing
Getting ready
The original USAairlineData2016 function has been sorted based on QUARTER and MONTH, but in this recipe, the task is to organize the rows based on the origin of the flight, and then, the second level sorting will be done on destination. Once again, the same dataset will be used in this recipe.