summary-methods: Summary for phylo4/phylo4d objects

summary-methodsR Documentation

Summary for phylo4/phylo4d objects

Description

Summary of information for the tree (phylo4 only) and/or the associated data (phylo4d).

Usage

summary(object, ...)

## S4 method for signature 'phylo4'
summary(object, quiet = FALSE)

## S4 method for signature 'phylo4d'
summary(object, quiet = FALSE)

nodeType(object)

## S4 method for signature 'phylo4'
nodeType(object)

Arguments

object

a phylo4d object

...

optional additional elements (not in use)

quiet

Should the summary be displayed on screen?

Value

The nodeType method returns named vector which has the type of node (internal, tip, root) for value, and the node number for name

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

list("name")

the name of the object

list("nb.tips")

the number of tips

list("nb.nodes")

the number of nodes

list("mean.el")

mean of edge lengths

list("var.el")

variance of edge lengths (estimate for population)

list("sumry.el")

summary (i.e. range and quartiles) of the edge lengths

list("degree")

(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

list("sumry.tips")

(optional) summary for the data associated with the tips

list("sumry.nodes")

(optional) summary for the data associated with the internal nodes

Author(s)

Ben Bolker, Thibaut Jombart, Francois Michonneau

See Also

phylo4d-methods constructor and 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 <- ape::read.tree(text=tOwls)
  P1 <- as(tree.owls, "phylo4")
  P1
  summary(P1)
  nodeType(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


phylobase documentation built on May 29, 2024, 11:24 a.m.