This function performs numerical analysis of mutation-selection balance with mutation from A to a and selection against (either or both of) Aa and aa.
mutation.selection(p0=1.0, w=c(1,0), u=0.001, time=100, show="q", pause=0,
ylim=c(0,1))
Starting frequency for the A allele.
Fitnesses of the heterozygote (Aa) and homozygote deleterious (aa) genotypes. The fitness of genotype AA is assumed to be 1.0.
Rate at which A alleles are converted to a alleles by mutation.
Number of generations to run the analysis.
Two options for plotting. "q"
shows the frequency of a through time; "fitness"
plots the mean fitness over time. The default is show="q"
.
Pause between generations. pause=0.01
(for instance) might smooth animation.
Limits on the y-axis for plotting.
The function creates one of three possible plots, depending on the value of show
.
The function also invisibly returns the frequency of the A allele through time and the mean population fitness as an object of class "mutation.selection"
that can be printed or re-plotted with associated print
and plot
methods, respectively. The plot
method also permits user control over various attributes of the appearance of the plot, such as the color of the plotted lines (color
), the line widths (lwd
), the limits of the y-axis (ylim
), and the type of line (e.g., "l"
vs. "s"
, via the argument type
).
# NOT RUN {
mutation.selection(w=c(1,0),time=100,ylim=c(0,0.1))
# }
Run the code above in your browser using DataLab