drop                  package:base                  R Documentation

_D_r_o_p _R_e_d_u_n_d_a_n_t _E_x_t_e_n_t _I_n_f_o_r_m_a_t_i_o_n

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

     Delete the dimensions of an array which have only one level.

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

     drop(x)

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

       x: an array (including a matrix).

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

     If 'x' is an object with a 'dim' attribute (e.g., a matrix or
     'array'), then 'drop' returns an object like 'x', but with any
     extents of length one removed.  Any accompanying 'dimnames'
     attribute is adjusted and returned with 'x': if the result is a
     vector the 'names' are taken from the 'dimnames' (if any).  If the
     result is a length-one vector, the names are taken from the first
     dimension with a dimname.

     Array subsetting ('[') performs this reduction unless used with
     'drop = FALSE', but sometimes it is useful to invoke 'drop'
     directly.

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

     'drop1' which is used for dropping terms in models.

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

     dim(drop(array(1:12, dim=c(1,3,1,1,2,1,2))))# = 3 2 2
     drop(1:3 %*% 2:4)# scalar product

