getOffsets {shiftR} | R Documentation |
Generate Random or Uniformly Spaced Permutation Offsets
Description
This functions generate offsets for permutation analysis
with shiftrPermBinary
.
Random, uniformly spaced, and complete sets are available via
getOffsetsRandom
, getOffsetsUniform
, and
getOffsetsAll
functions respectively.
The function getNOffestsMax
calculates
the maximum number of permutations (given the margin).
Usage
getOffsetsRandom(n, npermute, margin = 0.05)
getOffsetsUniform(n, npermute, margin = 0.05)
getOffsetsAll(n, margin)
getNOffsetsMax(n, margin)
Arguments
n |
Number of features in the permuted sets. |
npermute |
The number of offsets to be generated (number of permutations). |
margin |
Offsets by less than |
Value
Returns a set of permutation offsets for use in
shiftrPermBinary
function.
The set of offsets is
random for
getOffsetsRandom
,uniformly spaced for
getOffsetsUniform
, orall possible for
getOffsetsAll
.
The function getNOffestsMax
returns the
maximum number of permutations (given the margin).
Author(s)
Andrey A Shabalin andrey.shabalin@gmail.com
Examples
### Number of features, permutations, and margin
n = 100
npermute = 20
margin = 0.1
### Maximum number of permutations
# Should be 81 (from 10 to 90)
getNOffsetsMax(n, margin)
### Random offsets
getOffsetsRandom(n, npermute, margin)
### Uniformly spaced offsets
getOffsetsUniform(n, npermute, margin)
### All possible offsets
getOffsetsAll(n, margin)