sort dataframe dplyr

Use the arrange() function from the dplyr package to sort a dataframe in R. The arrange() function takes the dataframe name and the column name by which the dataframe should be sorted as its arguments. Use the desc() function to sort the dataframe in descending order. If you want to sort by multiple columns, use arrange() with multiple column names separated by commas.