phylo4-display {phylobase} | R Documentation |
Display methods for phylo4 and phylo4d phylogenetic trees
## 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)
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) |
The summary
method invisibly returns a list with the
following components:
|
the name of the object |
|
the number of tips |
|
the number of nodes |
|
mean of edge lengths |
|
variance of edge lengths (estimate for population) |
|
summary (i.e. range and quartiles) of the edge lengths |
|
(optional) degree (i.e. number of descendants) of each node; displayed only when there are polytomies |
|
(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.
signature(x = "phylo4")
: print methodsignature(object = "phylo4")
: show method signature(object = "phylo4")
: summary methodsignature(x = "phylo4")
: gives the slot namessignature(object = "phylo4")
: show first few
nodessignature(object = "phylo4")
: show last few
nodesBen Bolker, Thibaut Jombart
The phylo4
constructor, the checkPhylo4
function to check the validity of phylo4
objects. See also the
phylo4d
constructor and the phylo4d
class.
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