irnorm               package:iterators               R Documentation

_R_a_n_d_o_m _N_u_m_b_e_r _I_t_e_r_a_t_o_r_s

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

     These function returns an iterators that return random numbers of
     various distributions. Each one is a wrapper around a standard 'R'
     function.

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

     irnorm(..., count)
     irunif(..., count)
     irbinom(..., count)
     irnbinom(..., count)
     irpois(..., count)

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

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

     ...: arguments to pass to the underlying 'rnorm' function.

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

     An iterator that is a wrapper around the corresponding random
     number generator function.

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

       # create an iterator that returns three random numbers
       it <- irnorm(1, count=3)
       nextElem(it)
       nextElem(it)
       nextElem(it)
       try(nextElem(it))  # expect a StopIteration exception

