sort                 package:arules                 R Documentation

_S_o_r_t_i_n_g _A_s_s_o_c_i_a_t_i_o_n_s

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

     Provides the generic function 'SORT' and the S4 method to sort
     elements in class 'associations' (e.g., itemsets or rules)
     according to the value of measures stored in the association's
     slot 'quality' (e.g., support).

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

     ## S4 method for signature 'associations':
     sort(x, decreasing = TRUE, na.last = NA, 
         by = "support")

     ## deprecated since arules version 0.5-1
     ## S4 method for signature 'associations':
     SORT(x, by = "support", na.last = NA, 
         decreasing = TRUE)

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

       x: an object to be sorted.

decreasing: a logical. Should the sort be increasing or decreasing?
          (default is decreasing)

 na.last: for controlling the treatment of 'NAs'. If 'TRUE', missing
          values in the data are put last; if 'FALSE', they are put
          first; if 'NA', they are removed.

      by: a character string specifying the quality measure stored in
          'x' to be used to sort 'x'.

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

     An object of the same class as 'x'.

_S_e_e _A_l_s_o:

     'associations-class'

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

     data("Adult")

     ## Mine frequent itemsets with Eclat.
     fsets <- eclat(Adult, parameter = list(supp = 0.5))

     ## Print the 5 itemsets with the highest support as a data.frame.
     as(sort(fsets)[1:5], "data.frame")

