We can sort our data frame by a particular column using the order() function. Sort my_df by the quantity columns.

See that? The order() functions allows us to sort vectors. By default, it sorts in ascending order.