# 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)
# }
Run the code above in your browser using DataLab