Overview. The order() function in R is used to return a permutation that simply orders or rearranges a sequence of numeric, complex, character, or logical vectors in ascending or descending order by their index positions.