\name{rotate}
\alias{rotate}
-\title{Swopping sister clades}
+\title{Swapping sister clades}
\description{
For a given node, rotate exchanges the position of two clades descending from this node. It can handle dichotomies as well as polytomies. In the latter case, two clades from the polytomy are selected for swapping.}
\usage{
tre.new <- rotate(tre, 30)
# compare the results:
-X11() # open new graphical device
-par(mfrow=c(1,2)) # devide graphical device
+par(mfrow=c(1,2)) # split graphical device
plot(tre) # plot old tre
plot(tre.new) # plot new tree
# visualize labels of terminal nodes:
-X11() # open new graphical device
plot.phylo(tre)
tiplabels()
tre.new <- rotate(tre, c(12, 21))
# compare the results:
-X11() # open new graphical device
-par(mfrow=c(1,2)) # devide graphical device
+par(mfrow=c(1,2)) # split graphical device
plot(tre) # plot old tre
plot(tre.new) # plot new tree
tre.new <- rotate(tre, c("t3", "t14"))
# compare the results:
-X11() # open new graphical device
par(mfrow=c(1,2)) # devide graphical device
plot(tre) # plot old tre
plot(tre.new) # plot new tree