The number of permutations of n elements is n!. This function randomly rearranges the elements it times, and then deletes all duplicates. Thus it finds always less than it and n! permutations. If a confounding variable is provided, the function uses stratified permutation. This function is called by the functions omnibus and proprius.

intern.permu(n, it, group, kind)

Arguments

n

Number of samples.

it

Number of repetitions.

group

Either NULL or a factor of length n.

kind

computation : number between 0 and 1

Value

The function returns a matrix.

References

A Rauschenberger, MA Jonker, MA van de Wiel, and RX Menezes (2016). "Testing for association between RNA-Seq and high-dimensional data", BMC Bioinformatics. 17:118. html pdf (open access)

See also

This is an internal function. The user functions are cursus, omnibus, and proprius.

Examples

group <- as.factor(c('A','A','B','B','B')) set.seed(1) intern.permu(n=5,it=1000,group=group,kind=1)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] #> [1,] 1 1 2 1 2 2 2 1 2 1 1 2 #> [2,] 2 2 1 2 1 1 1 2 1 2 2 1 #> [3,] 3 5 3 4 4 3 5 4 4 5 3 5 #> [4,] 4 3 4 3 5 5 3 5 3 4 5 4 #> [5,] 5 4 5 5 3 4 4 3 5 3 4 3