reduce                 package:secr                 R Documentation

_C_o_m_b_i_n_e _C_o_l_u_m_n_s

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

     Combine columns in a matrix-like object to create a new data set
     using the first non-zero value.

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

     reduce (object, columns, ...)

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

  object: object that may be coerced to a matrix 

 columns: list in which each component is a vector of subscripts for
          columns to be pooled 

     ...: other arguments (not used currently) 

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

     The first element of 'columns' defines the columns of 'object' for
     the first new column, the second for the second new column etc.
     This is a generic method. A method exists for objects of class
     'capthist'.

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

     A matrix with number of columns equal to 'length(columns)'.

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

     Murray Efford murray.efford@otago.ac.nz

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

     'capthist', 'reduce.capthist'

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

     ## matrix with random zeros
     temp <- matrix(runif(20), nc = 4)
     temp[sample(20,10)] <- 0
     temp

     reduce(temp, list(1:2, 3:4))

