drift.selection: Simulation of genetic drift & natural selection at a...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/evolution.R

Description

Simulates drift and natural selection at a single biallelic locus within one or various populations.

Usage

1
	drift.selection(p0=0.5, Ne=100, w=c(1,1,1), ngen=400, nrep=10, colors=NULL, ...)

Arguments

p0

starting frequency for the A allele.

Ne

effective population size.

w

fitnesses of the three genotypes: AA, Aa, and aa.

nrep

number of replicate simulations.

ngen

total time, in number of generations, for the simulation.

colors

colors to use for plotting.

...

optional arguments. Presently the only arguments are type (e.g., "l", "s") and lwd in the plot method.

Value

The function creates a plot and returns an object of class "drift.selelction" consisting of list containing the allele frequency through time for each simulation. This object can be printed or plotted using corresponding methods. (See examples.)

Author(s)

Liam Revell liam.revell@umb.edu

See Also

genetic.drift, selection

Examples

1
2
3
4
	drift.selection()
	p<-drift.selection(p0=0.01,Ne=100,w=c(1,0.9,0.8),ngen=200,nrep=5)
	print(p)
	plot(p)

Example output

Object of class "drift.selection" consisting of
allele frequencies through time from 5 simulation(s) of
200 generations of genetic drift & natural selection
with normalized fitnesses of:
    W(AA) = 1 
    W(Aa) = 0.9 
    W(aa) = 0.8 

To plot enter plot('object_name') at the command line
interface.

learnPopGen documentation built on May 21, 2019, 1 a.m.