Sample Uniformily from various objects centered at the origin

rUnifSphere(n, D, radius = 1, shell_only = FALSE)

rUnifSimplex(n, D)

Arguments

n

number of samples to produce

D

dimension of object

radius

radius of sphere to sample from

shell_only

if TRUE samples from shell of object only, if false samples from entire region of object

Value

matrix of dimension D x n

Examples

# Sample Uniformily from Sphere (Full) x <- rUnifSphere(1000, 2, 2) plot(t(x), asp=1)
# Sample Uniformily from Sphere (Shell Only) x <- rUnifSphere(1000, 2, 2, shell_only=TRUE) plot(t(x), asp=1)
# Sample Uniformily from Simplex x <- rUnifSimplex(1000, 2) plot(t(x), asp=1)