icount               package:iterators               R Documentation

_C_o_u_n_t_i_n_g _I_t_e_r_a_t_o_r_s

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

     Returns an iterator that counts starting from one.

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

     icount(count)
     icountn(vn)

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

   count: number of times that the iterator will fire. If not
          specified, it will count forever.

      vn: vector of counts.

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

     The counting iterator.

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

       # create an iterator that counts from 1 to 3.
       it <- icount(3)
       nextElem(it)
       nextElem(it)
       nextElem(it)
       try(nextElem(it))  # expect a StopIteration exception

