forest_node: Build a Forest Node

Description Usage Arguments Details Value Author(s)

Description

Build a node. This is a low-level function that should not be needed that often.

Usage

1
forest_node(label = "", length = NA_real_, data = NULL)

Arguments

label

Label for the node (single-element character vector)

length

Branch length from root to tip (single-element numeric, non-negative)

data

Arbitrary data to associate with the node.

Details

Nodes are very lightly wrapped lists with the S3 class forest_node. I don't think that we need or want reference semantics here and this keeps things nice and lightweight. Methods have been defined for the subset and assignment operators so that the object only has the elements label, value and data. This will impose a minor lookup cost for the assignment operators, but reading should not be affected except for [ (so prefer \$ and [[).

Value

An object of type forest_node

Author(s)

Rich FitzJohn


richfitz/forest documentation built on May 27, 2019, 8:17 a.m.