DecisionNode: A decision node in a decision tree

DecisionNodeR Documentation

A decision node in a decision tree

Description

An R6 class representing a decision node in a decision tree.

Details

A class to represent a decision node in a decision tree. The node is associated with one or more branches to child nodes. Inherits from class Node.

Super class

rdecision::Node -> DecisionNode

Methods

Public methods

Inherited methods

Method new()

Create a new decision node.

Usage
DecisionNode$new(label)
Arguments
label

A label for the node. Must be defined because the label is used in tabulation of strategies. The label is automatically converted to a syntactically valid (in R) name to ensure it can be used as a column name in a data frame.

Returns

A new DecisionNode object.


Method grob()

Creates a grid::grob for drawing a decision node.

Usage
DecisionNode$grob(x, y, bb = FALSE)
Arguments
x

x coordinate of the node, unit object.

y

y coordinate of the node, unit object.

bb

Logical. If TRUE, function returns the bounding box.

Returns

A grob containing the symbol and label, or a bounding box as a grid::unit vector with 4 values: left, right, bottom, top.


Method clone()

The objects of this class are cloneable with this method.

Usage
DecisionNode$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Andrew J. Sims andrew.sims@newcastle.ac.uk


rdecision documentation built on April 3, 2025, 6:09 p.m.