phylobase (version 0.8.2)

nodeId: nodeId methods

Description

These functions gives the node (nodeId) or edge (edgeId) identity.

Usage

nodeId(x, type = c("all", "tip", "internal", "root"))
"nodeId"(x, type = c("all", "tip", "internal", "root"))
edgeId(x, type = c("all", "tip", "internal", "root"))
"edgeId"(x, type = c("all", "tip", "internal", "root"))

Arguments

x
a phylo4 or phylo4d object.
type
a character vector indicating which subset of the nodes or edges you are interested in.

Value

nodeId
an integer vector indicating node numbers
edgeId
a character vector indicating the edge identity

Details

nodeId returns the node in ascending order, and edgeId in the same order as the edges are stored in the edge matrix.

Examples

Run this code
  data(geospiza)
  identical(nodeId(geospiza, "tip"), 1:nTips(geospiza))
  nodeId(geospiza, "internal")
  edgeId(geospiza, "internal")
  nodeId(geospiza, "root")

Run the code above in your browser using DataLab