Learn R Programming

MNM (version 1.0-4)

runifsphere: Random Samples From the Unit Sphere

Description

Function to sample uniformly distributed observations on the unit sphere.

Usage

runifsphere(n, p)

Value

a matrix.

Arguments

n

number of random samples.

p

dimension of the unit sphere.

Author

Klaus Nordhausen

References

Oja, H. (2010), Multivariate Nonparametric Methods with R, Springer.

Examples

Run this code
X <- runifsphere(100,2)
plot(X, pty = "s")

Run the code above in your browser using DataLab