home *** CD-ROM | disk | FTP | other *** search
-
- _O_r_d_e_r_i_n_g _P_e_r_m_u_t_a_t_i_o_n
-
- order(...)
-
- _A_r_g_u_m_e_n_t_s:
-
- ... : a sequence of vectors.
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- order returns a permutation which will rearrange its
- first argument into ascending order. In the case of
- ties in the first vector, values in the second are used
- to break the ties. If the values are still tied,
- values in the later arguments are used to break the
- tie.
-
- NA values are treated as greater than any other values
- so that permutations returned by order move NA values
- to the top end of the array.
-
- _S_e_e _A_l_s_o:
-
- sort.
-
- _E_x_a_m_p_l_e_s:
-
- x <- c(5:1, 6:8, 12:9)
- y <- (x - 5)^2
- # rearrange matched vectors so that
- # the first is in ascending order
- o <- order(x)
- rbind(x[o], y[o])
-
-