2. Use the Rank function to get the sorted positions of each element of the vector.
3. Use the order function to get the indices in which the elements of the vector are sorted.
4. Modify the vector so that it has two identical elements and call Rank and order.
For identical elements, Rank returns an average of the indices where the values occur after sorting. The order function generates sequential indices based on their original order in the vector.