# Generating 10 random draws from Dirichlet distribution# parametrized using a vectorrdirichlet(10, c(1,1,1,1))# or parametrized using a matrix where each row# is a vector of parametersalpha <- matrix(c(1,1,1,1:3,7:9), ncol =3, byrow =TRUE)rdirichlet(10, alpha)
References
Devroye, L. (1986). Non-Uniform Random Variate Generation. Springer-Verlag.