sample                package:arules                R Documentation

_R_a_n_d_o_m _S_a_m_p_l_e_s _a_n_d _P_e_r_m_u_t_a_t_i_o_n_s

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

     Provides the generic function 'sample' and the S4 method to take a
     sample of the specified size from the elements of 'x' using either
     with or without replacement.  'sample' can be used to sample from
     a set of transactions or associations.

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

     sample(x, size, replace = FALSE, prob = NULL)

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

       x: object to be sampled from  (a set of 'associations' or
          'transactions').

    size: sample size.

 replace: a logical. Sample with replacement? 

    prob: a numeric vector of probability weights. 

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

     An object of the same class as 'x'.

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

     'associations-class', 'transactions-class', 'itemMatrix-class'.

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

     data("Adult")

     ## sample with replacement
     s <- sample(Adult, 500, replace = TRUE)
     s

