rotate2: Swapping Sister Clades

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function works exactly in the same manner as rotate in the ape package, but in addition can handle non-standard node label elements like those generated by read.beast.

Usage

1
rotate2(phy, node, polytom = c(1, 2))

Arguments

phy

An object of class "phylo".

node

A vector of mode numeric or character specifying the number of the node.

polytom

A vector of mode numeric and length two specifying the two clades that should be exchanged in a polytomy.

Details

Please refer to rotate.

Value

An object of class "phylo".

Author(s)

Christoph Heibl

See Also

read.beast, rotate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# a phylogeny of wild barley
# --------------------------
data(hordeum)
hordeum$tip.label <- LETTERS[1:20]

# rotate phylogeny at node 27
# ---------------------------
node <- 27
hordeum.rotated <- rotate2(hordeum, node)

# plot ...
par(mfcol = c(1, 2), mar = c(0.5, 0.5, 0.5, 0.5))
# ... unmodified tree and 
# -----------------------
plot(hordeum)
nodeInfo(node = node, label = "node to rotate", angle = 160, lex = 8)
node.support(hordeum$posterior, pos = "pretty")


# ... rotated tree
# ----------------
plot(hordeum.rotated, direction = "leftward")
nodeInfo(node = node, label = "rotated node", angle = 340, lex = 6)
node.support(hordeum.rotated$posterior, pos = "pretty")

fmichonneau/phyloch documentation built on May 16, 2019, 1:45 p.m.