powered by
Calculates the minor allele frequency (MAF) for a single SNP coded as: 0 = AA, 1 = AB, 2 = BB, and 9 = missing.
.maf(snp)
A single numeric value: the minor allele frequency (MAF).
A numeric vector of genotypes for one SNP. Values must be 0, 1, 2, or 9 (missing).
snp_data <- c(0, 0, 1, 2, 2, 9) .maf(snp_data)
Run the code above in your browser using DataLab