which.weight | R Documentation |
Returns a random index, weighted by the element magnitudes. This function is intended to be used as an optional strategy for trajectoryAssignments, resulting in randomly sampled cluster membership.
which.weight(x)
x |
A positive |
An integer
giving the index of the sampled element.
x = c(.01, .69, .3)
which.weight(x) #1, 2, or 3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.