halvesRanking: The workhorse of the package.

Description Usage Arguments Details Value

View source: R/halvesRanking.R

Description

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.

Usage

1
  halvesRanking(ranking, level = 0)

Arguments

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.

Details

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.

Value

A vector with the same dimension of ranking filled with a randomised order of points.


RecSelect documentation built on May 2, 2019, 5:01 p.m.