countpattern              package:e1071              R Documentation

_C_o_u_n_t _B_i_n_a_r_y _P_a_t_t_e_r_n_s

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

     Every row of the binary matrix `x' is transformed into a binary
     pattern and these patterns are counted.

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

     countpattern(x, matching=FALSE)

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

       x: A matrix of binary observations

matching: If TRUE an additional vector is returned which stores which
          row belongs to which pattern

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

     A vector of length `2\^ncol(x)' giving the number of times each
     pattern occurs in the rows of `x'. The names of this vector are
     the binary patterns. They are sorted according to their numeric
     value. If `matching' is `TRUE', a list of the following two
     vectors is returned. 

     pat: Numbers of patterns as described above.

matching: Vector giving the position of the pattern of each row of `x'
          in `pat'.

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

     Andreas Weingessel

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

     xx <- rbind(c(1,0,0),c(1,0,0),c(1,0,1),c(0,1,1),c(0,1,1))
     countpattern(xx)
     countpattern(xx, matching=TRUE)

