Learn R Programming

HardyWeinberg (version 1.6.1)

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)

Arguments

x

a vector or matrix with compositions

Value

a vector with allele frequencies

See Also

maf

Examples

Run this code
# NOT RUN {
   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