Skip to content
Prev 164461 / 398503 Next

generate combination multiset (set with repetition)

Dear Reuben,
On Thu, Dec 11, 2008 at 12:53 PM, baptiste auguie <ba208 at exeter.ac.uk> wrote:
Here is another way:

library(prob)
urnsamples(1:3, size = 2, ordered = FALSE, replace = TRUE)

You can convert to a matrix with as.matrix(), if desired.

Regards,
Jay