Sort the values:


        

        

Built-in R function: