Skip to contents

Computes node positions and edge metadata for plot.cta_ort. Terminal nodes receive integer x-slot positions (left-to-right in DFS right-first order); internal nodes are centered over their children.

Usage

ort_plot_data(object, target_class = NULL, class_labels = NULL, digits = 1L)

Arguments

object

A cta_ort from cta_fit(..., recursive = TRUE).

target_class

Integer target class for terminal node annotation, or NULL for a structural plot.

class_labels

Optional named character vector of class display names.

digits

Integer decimal places for proportion labels. Default 1.

Value

A list with elements:

nodes

data.frame: node_id, depth, x, y, is_terminal, label, n, stop_reason.

edges

data.frame: from_id, to_id, x0, y0, x1, y1, label.

strata

The strata table from the LORT object.

Note

ort_plot_data is a legacy compatibility name for the LORT method. See print.cta_ort for the naming note.