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)

_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'.

     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

