Learn R Programming

HardyWeinberg (version 1.7.5)

af: Function to compute allele frequencies

Description

Function af computes the allele frequencies for a matrix or a vector containing genotypic compositions.

Usage

af(x)

Value

a vector with allele frequencies

Arguments

x

a vector or matrix with compositions

Author

Jan Graffelman (jan.graffelman@upc.edu)

See Also

maf

Examples

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

Run the code above in your browser using DataLab