Description Usage Arguments Value Author(s) See Also Examples
Transforms SNPs to binary variables.
1 2 |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ## 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.