rotate(phy, group)
"phylo"
."all"
meaning to
rotate the whole tree."phylo"
.group
can be one of the three followings: (1) a
vector of mode character (= the labels of the tips); (2) a vector of
mode numeric (= the numbers of these labels in the vector
phy$tip.label
), or (3) the string "all"
. In cases (1)
and (2), the clade is rotated around the most recent common ancestor
of group
. If the latter is not monophyletic, the operation
fails and an error message is issued.
Note that the tree returned is the same than the original one, just
its representation is changed.bind.tree
, drop.tip
, root
data(bird.orders)
layout(matrix(1:4, 2, 2))
op <- par(cex = 0.5)
plot(bird.orders)
plot(rotate(bird.orders, 1:5))
plot(rotate(bird.orders, 6:23))
plot(rotate(bird.orders, "all"))
layout(matrix(1))
par(op)
### The tree hasn't changed:
all.equal(bird.orders, rotate(bird.orders, "all"))
Run the code above in your browser using DataLab