unif                 package:sfsmisc                 R Documentation

_N_i_c_e _U_n_i_f_o_r_m _P_o_i_n_t_s _i_n _I_n_t_e_r_v_a_l

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

     Give regularly spaced points on interval [-c,c] with mean 0
     (exactly) and variance about 1 (very close for *even* 'n' and
     larger 'round.dig').  Note that c depends on 'n'.

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

     unif(n, round.dig = 1 + trunc(log10(n)))

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

       n: positive integer specifying the number of points desired.

round.dig: integer indicating to how many digits the result is rounded.

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

     numeric vector of length 'n', symmetric around {0}, hence with
     exact mean '0', and variance approximately 1.

_N_o_t_e:

     It relies on the fact that Var(1,2,...,n) = n(n+1)/12.

_A_u_t_h_o_r(_s):

     Martin Maechler, ca 1990

_S_e_e _A_l_s_o:

     'runif' for producing uniform _random_ numbers.

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

     (u <- unif(8))
     var(u)

     (u. <- unif(8, 12))# more digits in result, hence precision for Var :
     var(u.)

