attrition {AlphaSimR}R Documentation

Lose individuals at random

Description

Samples individuals at random to remove from the population. The user supplies a probability for the individuals to be removed from the population.

Usage

attrition(pop, p)

Arguments

pop

an object of Pop-class

p

the expected proportion of individuals that will be lost to attrition.

Value

an object of Pop-class

Examples

#Create founder haplotypes
founderPop = quickHaplo(nInd=100, nChr=1, segSites=10)

#Set simulation parameters
SP = SimParam$new(founderPop)

#Create population
pop = newPop(founderPop, simParam=SP)

#Lose an expected 5% of individuals
pop = attrition(pop, p=0.05)


[Package AlphaSimR version 1.3.2 Index]