View source: R/gl.sim.Neconst.r
| gl.sim.Neconst | R Documentation |
This function simulates a population with a constant mutation rate using a beta distribution for allele frequencies.
gl.sim.Neconst(ninds, nlocs, mutation_rate = 1e-08, verbose = 0)
ninds |
Number of individuals in the population [required]. |
nlocs |
Number of loci in the population [required]. |
mutation_rate |
Mutation rate per generation (default is 1e-8) [default 1e-8]. |
verbose |
Verbosity level (default is 0). |
The function generates a genlight object with the specified number of individuals and loci, simulating allele frequencies based on a beta distribution. The mutation rate is used to calculate theta, which in turn is the parameter in the beta function.
A genlight object representing the simulated population.
Bernd Gruber (Post to https://groups.google.com/d/forum/dartr)
# Simulate a population with 50 individuals and 4000 loci
gg <- gl.sim.Neconst(ninds = 50, nlocs = 4000, mutation_rate = 1e-8, verbose = 0)
dartR.popgen::gl.sfs(gg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.