margin.table              package:base              R Documentation

_C_o_m_p_u_t_e _t_a_b_l_e _m_a_r_g_i_n

_D_e_s_c_r_i_p_t_i_o_n:

     Compute the sum of table entries over a given index.

_U_s_a_g_e:

     margin.table(x, margin)

_A_r_g_u_m_e_n_t_s:

       x: an array

  margin: index number (1 for rows, etc.) 

_D_e_t_a_i_l_s:

     This is really just `apply(x,margin,sum)' packaged up for newbies.

_V_a_l_u_e:

     The relevant marginal table.

_A_u_t_h_o_r(_s):

     Peter Dalgaard

_E_x_a_m_p_l_e_s:

     m<-matrix(1:4,2)
     margin.table(m,1)
     margin.table(m,2)

