demo_population_simulation: run several population simulations

View source: R/demo-population-simulation.R

demo_population_simulationR Documentation

run several population simulations

Description

run several population simulations and visualize the result, refer to vignette('pgmcs') for examples

Usage

demo_population_simulation(nrun, ngeneration, population, fitness, title)

Arguments

nrun

integer scalar. Number of simulation runs.

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.

title

string. Plot title.

Details

the underlying workhorse is population_simulation()

Value

an ggplot object

Shiny app

shiny::runApp(system.file('shiny', package = 'pgs'))


dongzhuoer/pgmcs documentation built on May 20, 2022, 6:36 a.m.