treePart: Define partitions of tips according from a tree

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

View source: R/partition.R

Description

The function treePart defines partitions of tips reflecting the topology of a tree. There are two possible outputs (handled by the argument result):
- basis mode: each node but the root is translated into a dummy vector having one value for each tip: this value is '1' if the tip descends from this node, and '0' otherwise.
- orthobasis: in this mode, an orthonormal basis is derived from the basis previously mentionned. This orthobasis was proposed in the orthogram (Ollier et al. 2006).

Usage

1
treePart(x, result=c("dummy", "orthobasis"))

Arguments

x

a tree of class phylo, phylo4 or phylo4d.

result

a character string specifying the type of result: either a basis of dummy vectors (dummy), or an orthobasis derived from these dummy vectors (orthobasis).

Details

Orthobasis produced by this function are identical to those stored in the \$Bscores component of deprecated phylog objects, from the ade4 package.

Value

A matrix of numeric vectors (in columns) having one value for each tip (rows).

Author(s)

Thibaut Jombart tjombart@imperial.ac.uk

References

Ollier, S., Chessel, D. and Couteron, P. (2005) Orthonormal Transform to Decompose the Variance of a Life-History Trait across a Phylogenetic Tree. Biometrics, 62, 471–477.

See Also

- listDD which is called by treePart.
- orthogram, which uses by default the orthobasis produced by treePart.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 

if(require(ape) & require(phylobase)){
## make a tree
x <- as(rtree(10),"phylo4")
partition <- treePart(x)
partition

## plot the dummy vectors with the tree
temp <- phylo4d(x, partition)
table.phylo4d(temp, cent=FALSE, scale=FALSE)
}

## End(Not run)

Example output

Loading required package: ade4
Loading required package: ape
Loading required package: phylobase

Attaching package: 'phylobase'

The following object is masked from 'package:ape':

    edges

adephylo documentation built on May 2, 2019, 4:54 p.m.