Learn R Programming

ade4 (version 1.7-5)

phylog: Phylogeny

Description

Create and use objects of class phylog. phylog.extract returns objects of class phylog. It extracts sub-trees from a tree. phylog.permut returns objects of class phylog. It creates the different representations compatible with tree topology.

Usage

"print"(x, ...) phylog.extract(phylog, node, distance = TRUE) phylog.permut(phylog, list.nodes = NULL, distance = TRUE)

Arguments

x, phylog
: an object of class phylog
...
: further arguments passed to or from other methods
node
: a string of characters giving a node name. The functions extracts the tree rooted at this node.
distance
: if TRUE, both functions retain branch lengths. If FALSE, they returns tree with arbitrary branch lengths (each branch length equals one)
list.nodes
: a list which elements are vectors of string of character corresponding to direct descendants of nodes. This list defines one representation compatible with tree topology among the set of possibilities.

Value

Returns a list of class phylog :

References

Ollier, S., Couteron, P. and Chessel, D. (2005) Orthonormal transforms to detect and describe phylogenetic autocorrelation. Biometrics (in press).

See Also

newick2phylog, plot.phylog

Examples

Run this code
marthans.tre <- NULL
marthans.tre[1] <-"((((1:4,2:4)a:5,(3:7,4:7)b:2)c:2,5:11)d:2,"
marthans.tre[2] <- "((6:5,7:5)e:4,(8:4,9:4)f:5)g:4);"
marthans.phylog <- newick2phylog(marthans.tre)
marthans.phylog

if(requireNamespace("ape", quietly=TRUE)) {
  marthans.phylo <- ape::read.tree(text = marthans.tre)
  marthans.phylo

  par(mfrow =c (1,2))
  plot(marthans.phylog, cnode = 3, f = 0.8, cle = 3)
  plot(marthans.phylo)
  par(mfrow = c(1,1))
}

Run the code above in your browser using DataLab