4 \alias{.compressTipLabel}
5 \alias{.uncompressTipLabel}
6 \title{Building Lists of Trees}
8 These functions help to build lists of trees of class \code{"multiPhylo"}.
11 \method{c}{phylo}(..., recursive = FALSE)
12 \method{c}{multiPhylo}(..., recursive = FALSE)
14 .uncompressTipLabel(x)
17 \item{\dots}{one or several objects of class \code{"phylo"} or
19 \item{recursive}{for compatibily with the generic (do not change).}
20 \item{x}{an object of class \code{"phylo"} or \code{"multiPhylo"}.}
23 These \code{c} methods do not check all the arguments, so it is the
24 user's responsibility to make sure that only objects of the same class
25 (either \code{"phylo"} or \code{"multiPhylo"}) are used.
27 \code{.compressTipLabel} transforms an object of class
28 \code{"multiPhylo"} by checking that all trees have the same tip
29 labels and renumbering the tips in the \code{edge} matrix so that the
30 tip numbers are also the same taking the first tree as the reference
31 (duplicated labels are not allowed). The returned object has a unique
32 vector of tip labels (\code{attr(x, "TipLabel")}).
34 \code{.uncompressTipLabel} does the reverse operation.
37 An object of class \code{"multiPhylo"}.
39 \author{Emmanuel Paradis}
41 \code{\link{summary.phylo}}, \code{\link{multiphylo}}
44 x <- c(rtree(4), rtree(2))
46 y <- c(rtree(4), rtree(4))
50 try(.compressTipLabel(x)) # error
51 a <- .compressTipLabel(y)
52 .uncompressTipLabel(a) # back to y
53 ## eventually compare str(a) and str(y)