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

