Colon                  package:base                  R Documentation

_C_o_l_o_n _O_p_e_r_a_t_o_r

_D_e_s_c_r_i_p_t_i_o_n:

     Generate regular sequences.

_U_s_a_g_e:

     from:to
        a:b

_A_r_g_u_m_e_n_t_s:

    from: starting value of sequence.

      to: (maximal) end value of the sequence.

    a, b: 'factor's of same length.

_D_e_t_a_i_l_s:

     The binary operator ':' has two meanings: for factors 'a:b' is
     equivalent to 'interaction(a, b)' (but the levels are ordered and
     labelled differently).

     For numeric arguments 'from:to' is equivalent to 'seq(from, to)',
     and generates a sequence from 'from' to 'to' in steps of '1' or
     '1-'.  Value 'to' will be included if it differs from 'from' by an
     integer up to a numeric fuzz of about '1e-7'.

_V_a_l_u_e:

     For numeric arguments, a numeric vector.  This will be of type
     'integer' if 'from' and 'to' are both integers and representable
     in the integer type, otherwise of type 'numeric'.

     For factors, an unordered factor with levels labelled as 'la:lb'
     and ordered lexicographically (that is, 'lb' varies fastest).

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.
      (for numeric arguments: S does not have ':' for factors.)

_S_e_e _A_l_s_o:

     'seq'.

     As an alternative to using ':' for factors, 'interaction'.

     For ':' used in the formal representation of an interaction, see 
     'formula'.

_E_x_a_m_p_l_e_s:

     1:4
     pi:6 # real
     6:pi # integer

     f1 <- gl(2,3); f1
     f2 <- gl(3,2); f2
     f1:f2 # a factor, the "cross"  f1 x f2

