# NOT RUN {
# Generate an example data set consisting of 5 rows and 12 columns,
# where it is assumed that each row corresponds to a SNP.
mat <- matrix("", 10, 12)
mat[c(1, 4, 6),] <- sample(c("AA", "AT", "TT"), 18, TRUE)
mat[c(2, 3, 10),] <- sample(c("CC", "CG", "GG"), 18, TRUE)
mat[c(5, 8),] <- sample(c("GG", "GT", "TT"), 12, TRUE)
mat[c(7, 9),] <- sample(c("AA", "AC", "CC"), 12, TRUE)
mat
# Recode the SNPs
recodeSNPs(mat)
# Recode the SNPs by assuming that the first letter in
# the heterogyzous genotype refers to the major allele.
recodeSNPs(mat, first.ref = TRUE)
# }
Run the code above in your browser using DataLab