View source: R/noise_injectors.R
noiseInjector.swapper | R Documentation |
This function introduces swap noise, i.e. a number of couples of
samples will have their phenotypes swapped.
The number of couples is computed so that the total fraction of
interested phenotypes approximates subset
.
noiseInjector.swapper(phenotypes, subset = 0.1)
phenotypes |
an array of numbers |
subset |
fraction of phenotypes to be interested by noise. |
the same passed phenotypes
, but with some elements swapped
Other noiseInjectors:
noiseInjector.dummy()
,
noiseInjector.norm()
,
noiseInjector.unif()
#a set of phenotypes phenos = 1:10 #swapping two elements phenos.sw2 = noiseInjector.swapper(phenos, 0.2) #swapping four elements phenos.sw4 = noiseInjector.swapper(phenos, 0.4) #swapping four elements again, since 30% of 10 elements #is rounded to 4 (two couples) phenos.sw4.again = noiseInjector.swapper(phenos, 0.3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.