Learn R Programming

thames (version 0.1.2)

runif_sphere: Uniform sampling on/in sphere

Description

Uniform sampling on a sphere or in a sphere, in arbitrary dimension. This code is borrowed directly from the uniformly package (https://CRAN.R-project.org/package=uniformly)

Usage

runif_on_sphere(n, d, r = 1)

runif_in_sphere(n, d, r = 1)

Value

The simulations in a n times d matrix.

Arguments

n

number of simulations

d

dimension of the space

r

radius of the sphere