genperms: Generate permutations of a phenotype vector

Description Usage Arguments Value Author(s) Examples

View source: R/genperms.R

Description

Given a vector, generate n.perm samples and return a matrix with each permutation in each column.

Usage

1
  genperms(pheno, n.perm = 0)

Arguments

pheno

a vector to be permuted

n.perm

the number of times to permute

Value

a matrix with dimensions length(pheno) x n.perm.

Author(s)

Chris Wallace <chris.wallace at cimr.cam.ac.uk>

Examples

1
2
y <- rbinom(50,2,0.3)
genperms(y,4)

Example output

Loading required package: snpStats
Loading required package: survival
Loading required package: Matrix
      [,1] [,2] [,3] [,4]
 [1,]    0    0    0    0
 [2,]    1    0    1    1
 [3,]    1    0    0    0
 [4,]    0    1    1    0
 [5,]    1    2    1    1
 [6,]    0    1    0    0
 [7,]    0    0    1    0
 [8,]    0    1    0    1
 [9,]    0    0    0    2
[10,]    0    0    0    1
[11,]    0    0    1    1
[12,]    1    2    1    2
[13,]    1    0    2    1
[14,]    0    2    1    0
[15,]    1    1    1    0
[16,]    2    1    1    2
[17,]    1    1    2    1
[18,]    0    1    0    0
[19,]    2    0    0    1
[20,]    0    2    0    2
[21,]    2    0    0    0
[22,]    1    1    1    2
[23,]    1    1    2    1
[24,]    1    1    0    0
[25,]    1    2    0    1
[26,]    1    1    0    1
[27,]    0    0    1    1
[28,]    2    0    0    0
[29,]    2    2    0    1
[30,]    0    1    0    0
[31,]    0    0    1    1
[32,]    2    0    2    1
[33,]    0    0    1    0
[34,]    0    1    1    2
[35,]    1    1    1    1
[36,]    1    1    0    0
[37,]    1    0    0    1
[38,]    0    0    0    0
[39,]    0    1    1    0
[40,]    0    0    1    1
[41,]    0    0    2    1
[42,]    1    1    1    0
[43,]    1    0    0    0
[44,]    1    1    1    1
[45,]    1    1    2    0
[46,]    1    0    1    1
[47,]    1    1    0    0
[48,]    0    0    1    0
[49,]    1    1    0    0
[50,]    0    1    1    1

wgsea documentation built on May 29, 2017, 7:02 p.m.