R Documentation |
Prints a phylo4 or phylo4d object in data.frame format with user-friendly column names
print(x, ...)
## S4 method for signature 'phylo4'
print(x, edgeOrder = c("pretty", "real"), printall = TRUE)
show(object)
## S4 method for signature 'phylo4'
show(object)
names(x)
## S4 method for signature 'phylo4'
names(x)
head(x, ...)
## S4 method for signature 'phylo4'
head(x, n = 20)
tail(x, ...)
## S4 method for signature 'phylo4'
tail(x, n = 20)
x |
a |
... |
optional additional arguments (not in use) |
edgeOrder |
in the data frame returned, the option 'pretty' returns the internal nodes followed by the tips, the option 'real' returns the nodes in the order they are stored in the edge matrix. |
printall |
default prints entire tree. printall=FALSE returns the first 6 rows |
object |
a |
n |
for head() and tail(), the number of lines to print |
This is a user-friendly version of the tree representation, useful for checking that objects were read in completely and translated correctly. The phylogenetic tree is represented as a list of numbered nodes, linked in a particular way through time (or rates of evolutionary change). The topology is given by the pattern of links from each node to its ancestor. Also given are the taxon names, node type (root/internal/tip) and phenotypic data (if any) associated with the node, and the branch length from the node to its ancestor. A list of nodes (descendants) and ancestors is minimally required for a phylo4 object.
A data.frame with a row for each node (descendant), sorted as
follows: root first, then other internal nodes, and finally tips.
The
returned data.frame has the following columns:
label |
Label for the taxon at the node (usually species name). |
node |
Node number, i.e. the number identifying the node in edge matrix. |
ancestor |
Node number of the node's ancestor. |
branch.length |
The branch length connecting the node to its ancestor (NAs if missing). |
node.type |
"root", "internal", or "tip". (internally generated) |
data |
phenotypic data associated with the nodes, with separate columns for each variable. |
This is the default show() method for phylo4, phylo4d. It prints the
user-supplied information for building a phylo4 object. For a full
description of the phylo4 S4 object and slots, see phylo4
.
Marguerite Butler, Thibaut Jombart jombart@biomserv.univ-lyon1.fr, Steve Kembel
tree.phylo <- ape::read.tree(text="((a,b),c);")
tree <- as(tree.phylo, "phylo4")
##plot(tree,show.node=TRUE) ## plotting broken with empty node labels: FIXME
tip.data <- data.frame(size=c(1,2,3), row.names=c("a", "b", "c"))
treedata <- phylo4d(tree, tip.data)
plot(treedata)
print(treedata)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.