sister: Identification of Sister Nodes and Clades

Description Usage Arguments Value See Also Examples

Description

For any given internal node in a phylogeny, this function returns the sister clade.

Usage

1
sister(phy, node, type = "terminal", label = FALSE)

Arguments

phy

An object of class phylo.

node

A vector of mode "numeric" or "character" giving the number(s) or name(s) of the tiplabel(s); these must be monophyletic.

type

A character string, may be "terminal", "internal", "daughter", "all", or any unambiguous abbreviation of these; "daughter" will return the MRCA of the sister clade of "node".

label

Logical, determining if tip number or tip labels will be returned.

Value

A vector of mode "numeric" or "character", containing either tip numbers or labels, respectively.

See Also

descendants, noi.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# A phylogeny of bark beetles ...
data(ips.tree)
tcol <- rep("black", Ntip(ips.tree))
tcol[ips.tree$tip.label %in% c("Ips_typographus", "Ips_nitidus")] <- "blue"
tcol[ips.tree$tip.label %in% c("Ips_duplicatus")] <- "red"
plot(ips.tree, no.margin = TRUE, tip.color = tcol)
# What is the sister species of Ips typographus?
sister(ips.tree, "Ips_typographus", label = TRUE)
# Return the MRCA of the sister clade of Ips duplicatus
x <- sister(ips.tree, "Ips_duplicatus", "daughter")
nodelabels(node = x, pch = 21, bg = "red")

ips documentation built on July 4, 2019, 5:04 p.m.