af {HardyWeinberg}R Documentation

Function to compute allele frequencies

Description

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

Usage

af(x)

Arguments

x a vector or matrix with compositions

Value

a vector with allele frequencies

Author(s)

Jan Graffelman (jan.graffelman@upc.edu)

See Also

maf

Examples

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

[Package HardyWeinberg version 1.4 Index]