Basic Sorting

We wish to sort the rows of a data frame by the values of one or more columns and we wish to identify the columns to use for sorting by explicitly specifying their name.

This section is organized as follows:

  • Single Column where we cover how to sort a data frame in ascending or descending order of the values of one column.
  • Multiple Columns where we cover how to sort a data frame in ascending or descending order by the values of multiple columns. When sorting by multiple columns, sorting is carried out in order where rows that have the same value for a former column are sorted by the value of a later column.
R
I/O