How can I generate uniformly distributed points on a circle? I am looking to generate 450 data points in R. There are three distinct sets 150 of each distributed in a circular band with different radii (at 1, 2.8 and 5).
In particular, I'm looking to reproduce the first graph on p546 of The Elements of Statistical Learning.

I would be very grateful for some assistance in the R code that could generate this data.
Thanks!
 A: In the case of a circle, it suffices to generate a uniform angle, $\theta$, on $[0,2\pi)$ and then make the radius, $r$, whatever is desired. If you want Cartesian, rather than polar co-ordinates, $x=r\cos\theta$ and $y=r\sin\theta$.
One really easy way to generate random points from a uniform distribution a d-sphere (a hypersphere in a space of arbitrary dimension $d+1$, with surface of dimension $d$), is to generate multivariate standard normals $X_i\sim N_{d+1}(0,I)$, and then scale by their distance from the origin: 
$$Y_i=X_i/||X_i||\,,$$ 
where $||.||$ is the Euclidean norm.
In R, let's generate on the surface of a (2-)sphere:
x <- matrix(rnorm(300),nc=3)
y <- x/sqrt(rowSums(x^2))
head(y)
           [,1]        [,2]       [,3]
[1,]  0.9989826 -0.03752732 0.02500752
[2,] -0.1740810  0.08668104 0.98090887
[3,] -0.7121632 -0.70011994 0.05153283
[4,] -0.5843537 -0.49940138 0.63963192
[5,] -0.7059208  0.20506946 0.67795451
[6,] -0.6244425 -0.70917197 0.32733262

head(rowSums(y^2))
[1] 1 1 1 1 1 1

Here's those data from two slightly different angles:

You can then scale to whatever other radius you like.
In low dimensions, there are faster ways, but if your normal random number generator is reasonably fast, it's pretty good in higher dimensions.
There are several packages on CRAN for circular statistics, including CircStats and circular. There's probably something on CRAN that generates uniform distributions on n-spheres for n>1, but I don't know of it.
