Example 1:
For instance, when we use the arrange() function to sort the Fingers data frame by Thumb, it will sort the values for Thumb in ascending order (smallest to largest) by default, like so:
# arrange Thumb in ascending order
arrange(Fingers, Thumb)
Example of output from running the code above:
Example 2:
But if we want the values to be sorted in descending order (largest to smallest) we can include the desc() function in the argument for arrange(), like so:
# arrange Thumb in descending order
arrange(Fingers, desc(Thumb))
Example of output from running the code above: