| combMyTree | R Documentation |
Graft polytomies on the tips of a class phylo object.
combMyTree(phy, data, tips, brlen = 0, unit = "absolute", annotate = FALSE)
phy |
An object of class |
data |
A data frame with at least one column whose contents must be
identical to the tip labels of the phylogeny in order to be matched automatically.
Optionally, the new tip labels for the extended phylogeny can stem from another
column, which is identified with |
tips |
A character string giving the name of the column in |
brlen |
A numeric giving either the absolute branch lengths or a
fraction of some other value (depending on |
unit |
A character string according to which the number given by
|
annotate |
Logical, if |
An object of class phylo with
nrow(data) tips.
forceEqualTipHeights
data(ips.tree)
## Simulate varying number of intraspecific observations
s <- sapply(1:Ntip(ips.tree), sample, x = 1:3, size = 1)
x <- rep(ips.tree$tip.label, times = s)
x <- data.frame(old_tips = x,
new_tips = paste0(x, unlist(lapply(s, function(z) 1:z))))
## Create polytomies, generate tip labels automatically
tre1 <- combMyTree(ips.tree, x, brlen = 0, unit = "absolute")
plot(tre1, no.margin = TRUE, cex =.5)
## Create polytomies, take tip labels from data frame
tre2 <- combMyTree(ips.tree, x, tips = "new_tips", brlen = 0, unit = "absolute")
plot(tre2, no.margin = TRUE, cex =.5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.