Given a number of boxes with a specified number of balls in each, randomly draw a number of balls from these boxes, recording how many balls was drawn from each. An empty box cannot be drawn from.
rfromboxes(n, balls, weights = NULL)
A natural number. The number of balls to draw.
A vector of natural numbers. The number of balls in each box to begin with.
A non-negative numeric vector the same length as balls
. The
relative probabilities of drawing a ball from each box. Default is each box
is equally likely to be drawn from.
A vector of natural numbers with the same length as balls
. The
number of balls drawn from each box.
rtoboxes