summary.staged_tree {stCEG}R Documentation

Summarise a Staged Tree Object

Description

Provides a visual and textual summary of a staged tree object, including counts of nodes and edges, node colour distributions, and uncoloured nodes in intermediate levels.

Usage

## S3 method for class 'staged_tree'
summary(object, ...)

Arguments

object

An object of class staged_tree, containing components nodes and edges in object$stagedtree$x, and optionally a priortable.

...

Additional arguments (currently unused).

Details

This function #prints a summary that includes:

If the crayon package is available, the function displays background colour blocks in the console to represent node colours.

Value

Invisibly returns a list containing summary components:

Also prints a human-readable summary to the console.

Note

White-coloured nodes (⁠#FFFFFF⁠) that are not in the minimum or maximum level are flagged as "Nodes left to be coloured."

Examples

data <- homicides
event_tree <- create_event_tree(data, columns = c(1,2,4,5), "both")
coloured_tree <- ahc_colouring(event_tree)
tree_priors <- specify_priors(coloured_tree, prior_type = "Uniform", ask_edit = FALSE)
staged_tree <- staged_tree_prior(coloured_tree, tree_priors)
homicides_ST_summary <- summary(staged_tree)


[Package stCEG version 0.1.0 Index]