View source: R/datasets-generators.R
sphere | R Documentation |
The function sphere()
enables uniform sampling of random i.i.d. points on
a (d-1)
-sphere in R^d
. The user should provide the number of
points n_samples
to be generated on the sphere and the ambient dimension
ambient_dim
. The radius of the sphere is optional and is equal to 1
by
default. Only random points generation is currently available.
sphere(n_samples, ambient_dim, radius = 1)
n_samples |
An integer value specifying the sample size. |
ambient_dim |
An integer value specifying the dimension of the ambient space. |
radius |
A numeric value specifying the radius of the sphere. Defaults
to |
A numeric array of shape n_\mathrm{samples} \times
\mathrm{ambient\_dim}
storing n_samples
points uniformly sampled on the
sphere of dimension ambient_dim - 1
.
sphere(10, 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.