dim                   package:spam                   R Documentation

_D_i_m_e_n_s_i_o_n_s _o_f _a_n _O_b_j_e_c_t

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

     Retrieve or set the dimension of an 'spam' object.

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

     # dim(x)
     # dim(x) <- value
     "dim<-.spam"(x,value)

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

       x: a 'spam' matrix

   value: A numeric two-vector, which is coerced to integer (by
          truncation).

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

     It is important to notice the different behavior of the
     replacement method for ordinary arrays and 'spam' objects (see
     'Examples'). Here, the elements are not simply rearranged but an
     entirely new matrix is constructed. If the new column dimension is
     smaller than the original, the matrix is also cleaned (with
     'spam.option("eps")' as filter).

     For the same operation as with regular arrays, use 'spam'

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

     'dim' retrieves the 'dimension' slot of the object.  It is a
     vector of mode 'integer'.

     The replacemnt method changes the dimension of the object by
     truncation or extension (with zeros).

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

     Reinhard Furrer

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

     'dim'.

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

     x <- diag(4)
     dim(x)<-c(2,8)
     x

     s <- diag.spam(4)
     dim(s) <- c(7,3)  # any positive value can be used

     s <- diag.spam(4)
     dim(s) <- c(2,8)  # result is different than x

