Description Usage Arguments Details Value
View source: R/halvesRanking.R
Takes a vector of zeros with length equal to a power of
2. When the length is at least 2, this matrix is split in
halve in to two equal subvectors. Then the
halvesRanking
function is applied recursively
while increasing the level with 1.
1 | halvesRanking(ranking, level = 0)
|
ranking |
A vector with length equal to a power of 2. Must start with a vector of zeros. |
level |
the current levels. Defaults to 0. |
When the ranking
vector recudes to a scalar, the
function returns this scalar. When the ranking
vector is split into two subvectors, the numbers 0 and 1
are assigned at random to one of the subvectors. Then the
values of the subvector, after recursively applying the
halvesRanking
function, is increased with the
random number times 2 to the power of the level.
WARNING: This function does not do any checking on the
sanity of ranking
and level
. That would be
a computational burden since the function is called
recursively.
A vector with the same dimension of ranking
filled
with a randomised order of points.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.