Learn R Programming

learnPopGen (version 1.0.4)

sexratio: Hypothetical analysis of frequency dependent selection on a sex determining genetic locus

Description

This function performs numerical analysis of a frequency dependent selection model of a hypothetical diploid sexually reproducing population in which sex is determined by the genotype at a biallelic genetic locus. Genotype AA are male, genotype aa are female, and genotype Aa might be male or female with probabilities that can be specified by the user. (Users may find, for instance, that setting sex.Aa=c(1,0) will result in evolution towards an XY sex determination system; whereas sex.Aa=c(0,1) will evolve towards a ZW system.)

Usage

sexratio(p0=0.01, time=40, show="p", pause=0, sex.Aa=c(0.5,0.5))

Arguments

p0

Starting frequency for the A allele. Individuals with AA genotypes are male, while individuals with Aa genotypes are male or female with probability given by sex.Aa.

time

Number of generations to run the analysis.

show

Two different options for plotting. "p" shows the frequency of A through time; "fitness" plots the mean fitness through time; "sex-ratio" plots the relative frequency of each sex; and "genotypes" plots the frequencies of the three genotypes in the population. The default is show="p".

pause

Pause between generations. pause=0.01 (for instance) might smooth animation.

sex.Aa

Probability that individuals with genotype Aa are male or female, respectively.

Value

The function creates one of four possible plots, depending on the value of show. Numerical analysis of this model shows how frequency dependent selection should favor alleles that tend to produce the rarer sex in the population.

The function invisibly returns an object of class "sexratio" that can be printed or re-plotted by the user. (See examples.)

See Also

freqdep

Examples

Run this code
# NOT RUN {
	sexratio()
	sexratio(p0=0.001,show="sex-ratio")
	sexratio(p0=0.001,show="fitness")
	object<-sexratio(p0=0.001,sex.Aa=c(0.9,0.1),
		time=20)
	print(object)
	par(mfrow=c(2,1))
	plot(object,lwd=4,type="s",show="sex-ratio")
	plot(object,lwd=4,type="s",show="genotypes")
	par(mfrow=c(1,1))
	
# }

Run the code above in your browser using DataLab