Transformation of SNPs to Binary Variables
Transforms SNPs to binary variables.
snp2bin(mat, domrec = TRUE, refAA = FALSE, snp.in.col = TRUE, monomorph = 0)
mat |
a matrix or data frame in which the genotypes of all SNPs are coded
either by |
domrec |
should each SNP be coded by two dummy variables from which one codes for
a recessive, and the other for a dominant effect? If |
refAA |
codes |
snp.in.col |
does each column of |
monomorph |
a non-negative number. If a dummy variable contains |
A matrix containing the binary dummy variables.
Holger Schwender, holger.schwender@udo.edu
## Not run: # Generate an example data set consisting of 10 rows (observations) # and 5 columns (SNPs). mat <- matrix(sample(3, 50, TRUE), 10) colnames(mat) <- paste("SNP", 1:5, sep = "") # Transform each SNP into two dummy variables, one that codes for # a recessive effect and one that codes for a dominant effect. snp2bin(mat) # Transform each SNP into three dummy variables, where each of # these variables codes for one of the three genotypes. snp2bin(mat, domrec = FALSE) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.