Learn R Programming

HardyWeinberg (version 1.7.5)

maf: Function to compute minor allele frequencies

Description

Function maf computes the minor allele frequency for a matrix or vector of compositions.

Usage

maf(x)

Value

a vector of minor allele frequencies.

Arguments

x

a vector or matrix of genotypic compositions

Author

Jan Graffelman (jan.graffelman@upc.edu)

Examples

Run this code
   X <- as.vector(rmultinom(1,100,c(0.5,0.4,0.1)))
   X <- X/sum(X)
   print(X)
   print(maf(X))

Run the code above in your browser using DataLab