population_simulation: simulate genetic drift in a finite population

Description Usage Arguments Value Examples

View source: R/population-simulation.R

Description

simulate genetic drift in a finite population for one gene with two alleles

Usage

1
population_simulation(ngeneration, population, fitness = c(1, 1, 1))

Arguments

ngeneration

integer scalar. Number of generations

population

integer vector. How many dominant homozygotes, heterozygotes, and recessive homozygotes do the initial population contain. For example, c(2, 5, 3) means 2 AA, 5 Aa and 3 aa.

fitness

numeric vector. The fitness value of AA, Aa and aa. c(1, 1, 1) means no natural selection.

Value

numeric vector. The frequency of allele A.

Examples

1
population_simulation(30, c(0, 10, 0))

dongzhuoer/pgmcs documentation built on Dec. 13, 2018, 10:31 p.m.