rsphere                 package:ggm                 R Documentation

_R_a_n_d_o_m _v_e_c_t_o_r_s _o_n _a _s_p_h_e_r_e

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

     Generates a sample of points uniformly distributed on the surface
     of a sphere in d-space.

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

     rsphere(n, d)

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

       n: an integer, the sample size.

       d: an integer, the dimension of the space. For example, a circle
          is defined in 2D-space, a sphere in 3D-space.

_D_e_t_a_i_l_s:

     The algorithm is based on normalizing to length 1 each d-vector of
     a sample from a multivariate normal N(0, I).

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

     a matrix of 'n' rows and 'd' columns.

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

     Giovanni M. Marchetti

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

     'rnorm', 'rcorr'

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

     ## 100 points on circle
     z <- rsphere(100,2)
     plot(z)

     ## 100 points on a sphere
     z <- rsphere(100, 3)
     pairs(z)

