nodeId-methods: nodeId methods

Description Usage Arguments Details Value Examples

Description

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

Usage

1
2
3
4
5
6
7
8
9
nodeId(x, type = c("all", "tip", "internal", "root"))

## S4 method for signature 'phylo4'
nodeId(x, type = c("all", "tip", "internal", "root"))

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

## S4 method for signature 'phylo4'
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.

Details

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

Value

nodeId

an integer vector indicating node numbers

edgeId

a character vector indicating the edge identity

Examples

1
2
3
4
5
  data(geospiza)
  identical(nodeId(geospiza, "tip"), 1:nTips(geospiza))
  nodeId(geospiza, "internal")
  edgeId(geospiza, "internal")
  nodeId(geospiza, "root")

phylobase documentation built on March 26, 2020, 7:44 p.m.