c.phylo: Building Lists of Trees

Description Usage Arguments Details Value Author(s) See Also Examples

Description

These functions help to build lists of trees of class "multiPhylo".

Usage

1
2
3
4
5
6
## S3 method for class 'phylo'
c(..., recursive = FALSE)
## S3 method for class 'multiPhylo'
c(..., recursive = FALSE)
.compressTipLabel(x)
.uncompressTipLabel(x)

Arguments

...

one or several objects of class "phylo" or "multiPhylo".

recursive

for compatibily with the generic (do not change).

x

an object of class "phylo" or "multiPhylo".

Details

These c methods do not check all the arguments, so it is the user's responsibility to make sure that only objects of the same class (either "phylo" or "multiPhylo") are used.

.compressTipLabel transforms an object of class "multiPhylo" by checking that all trees have the same tip labels and renumbering the tips in the edge matrix so that the tip numbers are also the same taking the first tree as the reference (duplicated labels are not allowed). The returned object has a unique vector of tip labels (attr(x, "TipLabel")).

.uncompressTipLabel does the reverse operation.

Value

An object of class "multiPhylo".

Author(s)

Emmanuel Paradis

See Also

summary.phylo, multiphylo

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- c(rtree(4), rtree(2))
x
y <- c(rtree(4), rtree(4))
z <- c(x, y)
z
print(z, TRUE)
try(.compressTipLabel(x)) # error
a <- .compressTipLabel(y)
.uncompressTipLabel(a) # back to y
## eventually compare str(a) and str(y)

gjuggler/ape documentation built on May 17, 2019, 6:03 a.m.