Learn R Programming

phytools (version 1.2-0)

minRotate: Rotates all nodes of the tree to minimize the difference in order with a vector

Description

This function rotates all the nodes of the tree to try and minimize the different between the order of the tips and the rank-order of a numeric vector x or (in the case of tipRotate the actual integer vector, x.

Usage

minRotate(tree, x, ...)
tipRotate(tree, x, ...)

Value

A node-rotated object of class "phylo".

Arguments

tree

tree.

x

numeric vector.

...

optional arguments to be used by tipRotate. Presently optional arguments can be fn, function to be used to compute the distance between the order of the tip labels in tree and the numeric vector x (presently fn=function(x) x^2 by default); methods, the method or methods of tree traversal (can be "pre", "post", or c("pre","post"), for pre-, post-, or both pre- and post-order tree traversal); rotate.multi, whether to rotate multifurcations in all possible ways using rotate.multi (defaults to FALSE); and print, a logical argument specifying whether to print the search progress or to behave quietly. Only the option print is available for minRotate.

Author

Liam Revell liam.revell@umb.edu

Details

Both functions are designed primarily to be used internally by other phytools functions and particularly by phylo.to.map (in the case of minRotate) and by cophylo (in the case of tipRotate).

References

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