phylo4-display {phylobase}R Documentation

Displaying phylo4 object

Description

Display methods for phylo4 and phylo4d phylogenetic trees

Usage

    ## S4 method for signature 'phylo4':
    print(x, edgeOrder = c("pretty", "real"), printall)
    ## S4 method for signature 'phylo4':
    summary(object, quiet=FALSE)
    ## S4 method for signature 'phylo4':
    show(object)
    ## S4 method for signature 'phylo4':
    names(x)

Arguments

x a phylo4 object
object a phylo4 object
edgeOrder Character string indicating whether the edges should be printed as ordered in the tree "real" (e.g. preorder or postorder), or "pretty" printed with tips collated together
printall If TRUE all tip labels are printed
quiet a logical stating whether the results of the summary should be printed to the screen (FALSE, default) or not (TRUE)

Value

The summary method invisibly returns a list with the following components:

name the name of the object
nb.tips the number of tips
nb.nodes the number of nodes
mean.el mean of edge lengths
var.el variance of edge lengths (estimate for population)
sumry.el summary (i.e. range and quartiles) of the edge lengths
degree (optional) degree (i.e. number of descendants) of each node; displayed only when there are polytomies
polytomy (optional) type of polytomy for each node: ‘node’, ‘terminal’ (all descendants are tips) or ‘internal’ (at least one descendant is an internal node); displayed only when there are polytomies


The names method returns a vector of characters corresponding to the names of the slots.

Methods

print
signature(x = "phylo4"): print method
show
signature(object = "phylo4"): show method
summary
signature(object = "phylo4"): summary method
names
signature(x = "phylo4"): gives the slot names
head
signature(object = "phylo4"): show first few nodes
tail
signature(object = "phylo4"): show last few nodes

Author(s)

Ben Bolker, Thibaut Jombart

See Also

The phylo4 constructor, the checkPhylo4 function to check the validity of phylo4 objects. See also the phylo4d constructor and the phylo4d class.

Examples


  tOwls <- "(((Strix_aluco:4.2,Asio_otus:4.2):3.1,Athene_noctua:7.3):6.3,Tyto_alba:13.5);"
  tree.owls <- read.tree(text=tOwls)
  P1 <- as(tree.owls, "phylo4")
  P1
  summary(P1)

  ## summary of a polytomous tree
  E <- matrix(c(
      8,  9,
      9, 10,
     10,  1,
     10,  2,
      9,  3,
      9,  4,
      8, 11,
     11,  5,
     11,  6,
     11,  7,
      0,  8), ncol=2, byrow=TRUE)

  P2 <- phylo4(E)
  nodeLabels(P2) <- as.character(nodeId(P2, "internal"))
  plot(P2, show.node.label=TRUE)
  sumryP2 <- summary(P2)
  sumryP2

[Package phylobase version 0.5 Index]