| genetic.drift {learnPopGen} | R Documentation |
Genetic drift simulation
Description
This function simulates genetic drift at a biallelic genetic locus with no selection and no mutation in a sexually reproducing diploid population or set of populations. It is essentially redundant with drift.selection, but in which there is no difference in relative fitness among genotypes; however, it also allows the user to visualize heterozygosity or genetic variation through time - options that are not yet implemented in drift.selection.
Usage
genetic.drift(p0=0.5, Ne=20, nrep=10, time=100, show="p", pause=0.1, ...)
Arguments
p0 |
Starting frequency for the A allele. |
Ne |
Effective population size. |
nrep |
Number of replicate simulations. |
time |
Total time, in number of generations, for the simulation. |
show |
Various options for plotting. |
pause |
Pause between generations. |
... |
optional arguments. In |
Value
The function creates one of several possible plots, depending on the value of show.
The function also invisibly returns an object of class "genetic.drift" that can be printed or re-plotted by the user using corresponding print and plot methods. (See examples.)
Author(s)
Liam Revell liam.revell@umb.edu
See Also
drift.selection, founder.event, selection
Examples
## Not run:
genetic.drift()
object<-genetic.drift(p0=0.7,show="heterozygosity")
plot(object,show="genotypes")
## End(Not run)