alloc | R Documentation |
Allocates tgt
of something to length(bucketLims)
different "buckets" subject to the constraint that each bucket has a maximum value of bucketLims
that cannot be exceeded. By default counts are distributed equally between buckets, but weights can be provided using ws
to have the redistribution prefer certain buckets over others.
alloc(tgt, bucketLims, ws = rep(1/length(bucketLims), length(bucketLims)))
tgt |
Value to distribute between buckets. |
bucketLims |
The maximum value that each bucket can take. Must be a vector of positive values. |
ws |
Weights to be used for each bucket. Default value makes all buckets equally likely. |
A vector of the same length as bucketLims
containing values distributed into buckets.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.