ScalarObject-class          package:Biobase          R Documentation

_U_t_i_l_i_t_y _c_l_a_s_s_e_s _f_o_r _l_e_n_g_t_h _o_n_e (_s_c_a_l_a_r) _o_b_j_e_c_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     These classes represent scalar quantities, such as a string or a
     number and are useful because they provide their own validity
     checking.  The classes 'ScalarCharacter', 'ScalarInteger', and
     'ScalarNumeric' all extend their respective base vector types and
     can be used interchangeably (except they should always have length
     one).

     The 'mkScalar' factory function provides a convenient way of
     creating 'Scalar<type>' objects (see the examples section below).

_U_s_a_g_e:

     mkScalar(obj)

_A_r_g_u_m_e_n_t_s:

     obj: An object of type 'character', 'integer', or 'double'

_A_u_t_h_o_r(_s):

     Seth Falcon

_E_x_a_m_p_l_e_s:

     v <- list(mkScalar("a single string"),
               mkScalar(1),
               mkScalar(1L))
     sapply(v, class)
     sapply(v, length)

