]> git.donarmstrong.com Git - ape.git/blob - man/c.phylo.Rd
new code for reading FASTA files
[ape.git] / man / c.phylo.Rd
1 \name{c.phylo}
2 \alias{c.phylo}
3 \alias{c.multiPhylo}
4 \alias{.compressTipLabel}
5 \alias{.uncompressTipLabel}
6 \title{Building Lists of Trees}
7 \description{
8   These functions help to build lists of trees of class \code{"multiPhylo"}.
9 }
10 \usage{
11 \method{c}{phylo}(..., recursive = FALSE)
12 \method{c}{multiPhylo}(..., recursive = FALSE)
13 .compressTipLabel(x)
14 .uncompressTipLabel(x)
15 }
16 \arguments{
17   \item{\dots}{one or several objects of class \code{"phylo"} or
18     \code{"multiPhylo"}.}
19   \item{recursive}{for compatibily with the generic (do not change).}
20   \item{x}{an object of class \code{"phylo"} or \code{"multiPhylo"}.}
21 }
22 \details{
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.
26
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")}).
33
34   \code{.uncompressTipLabel} does the reverse operation.
35 }
36 \value{
37   An object of class \code{"multiPhylo"}.
38 }
39 \author{Emmanuel Paradis}
40 \seealso{
41   \code{\link{summary.phylo}}, \code{\link{multiphylo}}
42 }
43 \examples{
44 x <- c(rtree(4), rtree(2))
45 x
46 y <- c(rtree(4), rtree(4))
47 z <- c(x, y)
48 z
49 print(z, TRUE)
50 try(.compressTipLabel(x)) # error
51 a <- .compressTipLabel(y)
52 .uncompressTipLabel(a) # back to y
53 ## eventually compare str(a) and str(y)
54 }
55 \keyword{manip}