Learn R Programming

dartR.sim (version 0.71)

gl.sim.Neconst: Simulate a population with constant mutation rate

Description

This function simulates a population with a constant mutation rate using a beta distribution for allele frequencies.

Usage

gl.sim.Neconst(ninds, nlocs, mutation_rate = 1e-08, verbose = 0)

Value

A genlight object representing the simulated population.

Arguments

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).

Author

Bernd Gruber (Post to https://groups.google.com/d/forum/dartr)

Details

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.

Examples

Run this code
# 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)

Run the code above in your browser using DataLab