strataG (version 2.4.905)

alleleFreqs: Allele Frequencies

Description

Calculate allele frequencies or proportions for each locus.

Usage

alleleFreqs(g, by.strata = FALSE, type = c("freq", "prop"))

Arguments

g

a '>gtypes object.

by.strata

logical determining if results should be returned by strata?

type

return counts ("freq") or proportions ("prop")

Value

A list of allele frequencies for each locus. Each element is a vector (by.strata = FALSE) or matrix (by.strata = TRUE) with the frequency or proportion of each allele.

Examples

Run this code
# NOT RUN {
data(msats.g)

f <- alleleFreqs(msats.g)
f$D11t # Frequencies for Locus D11t

f.pop <- alleleFreqs(msats.g, TRUE, "prop")
f.pop$EV94[, "Coastal"] # Proportions of EV94 alleles in the Coastal population

# }

Run the code above in your browser using DataLab