combMyTree: Graft Polytomies on Tips of Phylogeny

View source: R/combMyTree.R

combMyTreeR Documentation

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)

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.

Value

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

See Also

forceEqualTipHeights

Examples

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)

heibl/ips documentation built on April 24, 2024, 3:19 a.m.