coalescent.plot {learnPopGen} | R Documentation |
Creates a (usually animated) simulation of gene coalescence within a population
Description
Coalescence or coalescent theory is a model for genetic drift within a population in which we envision gene copies merging or "coalescing" into ancestors in the past. This function generates a(n) (optionally animated) visualization of this process of coalescence within a population.
Usage
coalescent.plot(n=10, ngen=20, colors=NULL, ...)
## S3 method for class 'coalescent.plot'
print(x, ...)
## S3 method for class 'coalescent.plot'
plot(x, ...)
Arguments
n |
number of haploid individuals or gene copies. |
ngen |
number of generations. |
colors |
colors to use for plotting individuals and lines. By default, the function tries to use a contrasting color scheme such that adjacent allele copies are dissimilar (to facilitate visualization of the coalescent process.) |
x |
object of class |
... |
optional arguments. For |
Value
Creates a plot or animation.
Invisibly returns an object of class "coalescent.plot"
containing the alleles (coded numerically) and the parent-offspring relationships from the coalescent simulation. This object can be printed or re-plotted using print
and plot
methods. (See examples.)
Author(s)
Liam Revell liam.revell@umb.edu
See Also
drift.selection
, genetic.drift
Examples
coalescent.plot()
## Not run:
coalescent.plot(n=20,ngen=30,col.order="alternating")
object<-coalescent.plot()
print(object)
plot(object)
## End(Not run)