Learn R Programming

phylobase (version 0.6.8)

phylo4-display: Displaying phylo4 object

Description

Display methods for phylo4 and phylo4d phylogenetic trees

Usage

## S3 method for class 'phylo4':
print(x, edgeOrder = c("pretty", "real"), printall)
    ## S3 method for class 'phylo4':
summary(object, quiet=FALSE)
    ## S3 method for class 'phylo4':
show(object)
    ## S3 method for class '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:
  • namethe name of the object
  • nb.tipsthe number of tips
  • nb.nodesthe number of nodes
  • mean.elmean of edge lengths
  • var.elvariance of edge lengths (estimate for population)
  • sumry.elsummary (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.

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

Run this code
tOwls <- "(((Strix_aluco:4.2,Asio_otus:4.2):3.1,Athene_noctua:7.3):6.3,Tyto_alba:13.5);"
  tree.owls <- ape::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

Run the code above in your browser using DataLab