runif_in_simplex | R Documentation |
Uniform sampling in a simplex (arbitrary dimension).
runif_in_simplex(n, simplex)
n |
number of simulations |
simplex |
a |
The simulations in a n
times d
matrix.
In dimension 3, you can use runif_in_tetrahedron
instead.
simplex <- rbind(c(0,0,0), c(1,0,0), c(1,1,0), c(1,1,2))
sims <- runif_in_simplex(1000, simplex)
library(rgl)
points3d(sims)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.