prop.table               package:base               R Documentation

_E_x_p_r_e_s_s _T_a_b_l_e _E_n_t_r_i_e_s _a_s _F_r_a_c_t_i_o_n _o_f _M_a_r_g_i_n_a_l _T_a_b_l_e

_D_e_s_c_r_i_p_t_i_o_n:

     This is really 'sweep(x, margin, margin.table(x, margin), "/")'
     for newbies, except that if 'margin' has length zero, then one
     gets 'x/sum(x)'.

_U_s_a_g_e:

     prop.table(x, margin=NULL)

_A_r_g_u_m_e_n_t_s:

       x: table 

  margin: index, or vector of indices to generate margin for

_V_a_l_u_e:

     Table like 'x' expressed relative to 'margin'

_A_u_t_h_o_r(_s):

     Peter Dalgaard

_S_e_e _A_l_s_o:

     'margin.table'

_E_x_a_m_p_l_e_s:

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

