Learn R Programming

ips (version 0.0.13)

combMyTree: Graft Polytomies on Tips of Phylogeny

Description

Graft polytomies on the tips of a class phylo object.

Usage

combMyTree(phy, data, brlen = 0, annotate = FALSE)

Value

An object of class phylo with nrow(data) tips.

Arguments

phy

An object of class phylo.

data

A data frame containing two columns. The entries of one column must be identical to the tip labels of the phylogeny; the other column contains the new tip labels. The column are matched automatically.

brlen

A numeric giving the branch lengths for the polytomies.

annotate

Logical, if TRUE, the former tip labels will be turned into node labels. Note, that this will overwrite existing node labels.

See Also

forceEqualTipHeights

Examples

Run this code
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(x, paste0(x, unlist(lapply(s, function(z) 1:z))))
## Create polytomies
tre <- combMyTree(ips.tree, x)
plot(tre, no.margin = TRUE, cex =.5)

Run the code above in your browser using DataLab