rules-class              package:arules              R Documentation

_C_l_a_s_s "_r_u_l_e_s" - _A _S_e_t _o_f _R_u_l_e_s

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

     The 'rules' class represents a set of rules.

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects are the result of calling the function 'apriori'. Objects
     can also be created by calls of the form 'new("rules", ...)'.

_S_l_o_t_s:

     '_l_h_s': Object of class 'itemMatrix';  the left-hand-sides of the
          rules (antecedents)

     '_r_h_s': Object of class 'itemMatrix'; the right-hand-sides of the
          rules (consequents) 

     '_q_u_a_l_i_t_y': Object of class '"data.frame"'

_E_x_t_e_n_d_s:

     Class 'associations', directly.

_M_e_t_h_o_d_s:

     [ 'signature(x = "rules")'; extracts a subset of rules and the
          associated quality measures

     _c_o_e_r_c_e 'signature(from = "rules", to = "data.frame")';  represents
          the set of rules as a 'data.frame'

     _i_t_e_m_I_n_f_o 'signature(object = "rules")';   returns the whole item
          information data frame including item labels

     _l_a_b_e_l_s 'signature(object = "rules")'; returns labels for the rules
          ("{lhs} => {rhs}") as a 'character' vector 

     _l_e_n_g_t_h 'signature(x = "rules")'; returns the number of rules
          stored in the the set

     _l_h_s 'signature(x = "rules")'; returns the 'itemMatrix'
          representing the left-hand-side of the rules (antecedents)

     _l_h_s<- 'signature(x = "rules")'; replaces the 'itemMatrix'
          representing the left-hand-side of the rules (antecedents)

     _r_h_s 'signature(x = "rules")'; returns the 'itemMatrix'
          representing the right-hand-side of the rules (consequents)

     _r_h_s<- 'signature(x = "rules")'; replaces the 'itemMatrix'
          representing the right-hand-side of the rules (consequents)

     _s_u_b_s_e_t 'signature(x = "rules")'; selects a subset using
          restrictions on the quality measures or on the items present
          in the rules (see examples).

     _s_u_m_m_a_r_y 'signature(object = "rules")'

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

     Michael Hahsler

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

     'apriori', 'associations-class', 'itemMatrix-class',

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

     data("Adult_transactions")

     ## Mine rules.
     rules <- apriori(Adult_transactions, parameter = list(support = 0.4))

     ## Select a subset using an item in the right-hand-side
     ## and a quality measure/
     rules.sub <- subset(rules, subset = rhs %in% "sex" & lift > 1.3)

     ## Display rules.
     inspect(SORT(rules.sub)[1:3])

