Unique               package:geometry               R Documentation

_E_x_t_r_a_c_t _U_n_i_q_u_e _R_o_w_s

_D_e_s_c_r_i_p_t_i_o_n:

     'Unique' returns a vector, data frame or array like 'x' but with
     duplicate  elements removed.

_U_s_a_g_e:

     Unique(X, rows.are.sets=FALSE)

_A_r_g_u_m_e_n_t_s:

       X: Numerical matrix. 

rows.are.sets: If ''TRUE'', rows are treated as sets - i.e., to define
          uniqueness, the order of the rows does not matter. 

_V_a_l_u_e:

     Matrix of the same number of columns as 'x', with the unique rows
     in 'x' sorted according to the columns of 'x'. If 'rows.are.sets =
     TRUE' the rows are also sorted.

_A_u_t_h_o_r(_s):

     Raoul Grasman

_E_x_a_m_p_l_e_s:

     # `Unique' is faster than `unique'
     x = matrix(sample(1:(4*8),4*8),ncol=4)
     y = x[sample(1:nrow(x),3000,TRUE), ]
     gc(); system.time(unique(y))
     gc(); system.time(Unique(y))

     #
     z = Unique(y)
     x[matorder(x),]
     z[matorder(z),]

