Learn R Programming

phytools (version 0.6-44)

fitMk: Fits Mk model

Description

This function fits a so-called Mk model for discrete character evolution. It is primarily designed to be used inside of make.simmap.

Two plot methods are available. plot.fitMk plots an object of class "fitMk" returned by fitMk. plot.gfit plots an object of class "gfit" from geiger's fitDiscrete function. Both plots portray the fitted model using a graph of arrows connecting states.

Usage

fitMk(tree, x, model="SYM", fixedQ=NULL, ...)
# S3 method for fitMk
plot(x, ...)
# S3 method for gfit
plot(x, ...)

Arguments

tree

an object of class "phylo".

x

a vector of tip values for species; names(x) should be the species names. In the case of plot.fitMk, an object of class "fitMk".

model

model. See make.simmap or ace for details.

fixedQ

fixed value of transition matrix Q, if one is desired.

...

optional arguments, including pi, the prior distribution at the root node (defaults to pi="equal"). For plot method optional arguments include (but may not be limited to): signif, the number of digits for the rates to be plotted; main, a character vector of length two with the headings for each subplot; cex.main, cex.traits, and cex.rates, font sizes for the various text elements of the plot; and show.zeros, a logical argument specifying whether or not to plot arrows with the ML estimated transition rate is not different from zero (with tolerance specified by the optional argument tol).

Value

An object of class "fitMk". In the case of plot.fitMk, a plotted Mk model.

References

Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.

See Also

ace, make.simmap