phylo4-accessors {phylobase} | R Documentation |
Methods for S4 phylogeny classes
Description
Generic methods for phylogenetic trees represented as S4 classes
Usage
## S4 method for signature 'phylo4':
nNodes(x)
## S4 method for signature 'phylo4':
nTips(x)
## S4 method for signature 'phylo4':
edges(x, drop.root=FALSE, ...)
## S4 method for signature 'phylo4':
nEdges(x)
## S4 method for signature 'phylo4':
edgeOrder(x, ...)
## S4 method for signature 'phylo4':
hasEdgeLength(x)
## S4 method for signature 'phylo4':
edgeLength(x, node)
## S4 method for signature 'phylo4':
edgeLength(x, use.names=TRUE) <- value
## S4 method for signature 'phylo4':
nodeType(x)
## S4 method for signature 'phylo4':
isRooted(x)
## S4 method for signature 'phylo4':
rootEdge(x)
## S4 method for signature 'phylo4':
rootNode(x)
## S4 method for signature 'phylo4':
rootNode(x) <- value
Arguments
x |
a phylo4/phylo4d object |
node |
which edge lengths to extract (indexed by descendant
node) |
value |
a vector of edge lengths or a node number |
use.names |
Should the names of value be used to match
edge lengths provided? |
drop.root |
logical: drop root row from edge matrix? |
... |
additional parameters passed (currently ignored) |
Methods
- nTips
signature(object="phylo4")
: number of tips
- nNodes
signature(object="phylo4")
: number of internal nodes
- nEdges
signature(object = "phylo4")
: number of edges
- edges
signature(object = "phylo4")
: returns the edge
matrix
- edgeOrder
signature(object = "phylo4")
: returns the
order in which the edges are stored
- hasEdgeLength
signature(object = "phylo4")
: whether
tree has edge (branch) lengths
- edgeLength
signature(object = "phylo4")
: edge (branch)
lengths (or NAs if missing) ordered according to the edge matrix
- nodeType
signature(object = "phylo4")
: named vector
which has the type of node (internal, tip, root) for value, and the
node number for name
- isRooted
signature(object = "phylo4")
: whether tree is
rooted (i.e. has explicit root edge defined or root node has
<= 2 descendants)
- rootEdge
signature(object = "phylo4")
: root edge
Examples
data(geospiza)
edgeLength(geospiza,5)
edgeLength(geospiza,"olivacea")
edgeLength(geospiza,5:7)
[Package
phylobase version 0.5
Index]