sister | R Documentation |
For any given internal node in a phylogeny, this function returns the sister clade.
sister(phy, node, type = "terminal", label = FALSE)
phy |
An object of class |
node |
A vector of mode |
type |
A character string, may be |
label |
Logical, determining if tip number or tip labels will be returned. |
A vector of mode "numeric"
or "character"
, containing
either tip numbers or labels, respectively.
descendants
, noi
.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.