Given a number of boxes, randomly distribute n balls into these boxes.
rtoboxes(n, boxes, weights = NULL, capacities = NULL)
A natural number. The number of balls to put into the boxes.
A natural number. The number of boxes.
A non-negative numeric vector. The relative probabilities of putting a ball in each box. Default is each box is equally likely.
A vector of natural numbers. The capacity of each box. Default is each box has infinite capacity.
A vector of natural numbers with the same length as boxes
. The
number of balls placed in each box.
rfromboxes