HWData {HardyWeinberg} | R Documentation |
HWData generates samples of genotypic counts under various schemes. It mainly uses sampling from the multinomial distribution given Hardy-Weinberg allele frequencies.
HWData(n = 100, nm = 100, f = 0, p = NULL, pfixed = FALSE, exactequilibrium = FALSE, pdist = "runif", ...)
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 |
Xt |
the genotypic counts. |
Xc |
the genotypic compositions. |
Jan Graffelman (jan.graffelman@upc.edu)
HWTernaryPlot
n <- 100 nm <- 100 out <- HWData(n,nm)