The sort() function will sort a vector in R in either ascending or descending order. But a more powerful and flexible technique is to sort data by using the order() function to generate subscripts for the object containing the data (e.g., a data frame, matrix, or vector). In this video we demonstrate both techniques. While watching this video
you should open
Mod10Script.R and follow along with Example 8.
This video covers fundamental material of great importance for R
programming and is essential viewing.