r dataframe sort data by values in a column code example Example: descending order a list in r x_sorted = sort(x, decreasing = FALSE, na.last = NA, ...)