convertCodes              package:pscl              R Documentation

_c_o_n_v_e_r_t _e_n_t_r_i_e_s _i_n _a _r_o_l_l_c_a_l_l _m_a_t_r_i_x _t_o _b_i_n_a_r_y _f_o_r_m

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

     Convert roll call matrix to binary form using encoding
     information.

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

     convertCodes(object, codes = object$codes)

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

  object: 'rollcall' object

   codes: list, mapping entries in the 'votes' component of 'rollcall'
          object to 0 ('Nay'), 1 ('Yea') and 'NA' (missing,
          abstentions, etc). Defaults to the 'codes' component of the
          'rollcall' object.

_D_e_t_a_i_l_s:

     See 'rollcall' for details on the form of the 'codes' list.

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

     a 'matrix' with dimensions equal to the dimensions of the 'votes'
     component of the 'rollcall' object.

_N_o_t_e:

     Any entries in the 'votes' matrix that can not be mapped into
     'c(0,1,NA)' using the information in 'codes' are mapped to 'NA',
     with an informative message sent to the console.

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

     Simon Jackman jackman@stanford.edu

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

     'rollcall'

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

       data(s109)
       mat <- convertCodes(s109)
       table(mat,exclude=NULL)

