HWData {HardyWeinberg}R Documentation

Generating marker data in Hardy-Weinberg Equilibrium

Description

HWData generates samples of genotypic counts under various schemes. It mainly uses sampling from the multinomial distribution given Hardy-Weinberg allele frequencies.

Usage

HWData(n = 100, nm = 100, f = 0, p = NULL, pfixed = FALSE, exactequilibrium = FALSE, pdist = "runif", ...)

Arguments

n the sample size.
nm the number of markers (or samples).
f the inbreeding coefficient
p the allele frequency
pfixed if TRUE Haldane's distribution is used for sampling, if FALSE a multinomial distribution is used
exactequilibrium generates data in exact HWE if set to TRUE
pdist take a random allele frequency from a uniform or beta distribution of pfixed = FALSE and p is not given.
... specific parameters for the uniform or beta

Value

Xt the genotypic counts.
Xc the genotypic compositions.

Author(s)

Jan Graffelman (jan.graffelman@upc.edu)

See Also

HWTernaryPlot

Examples

n <- 100
nm <- 100
out <- HWData(n,nm)

[Package HardyWeinberg version 1.4 Index]