delete_nodes {stCEG}R Documentation

Delete Nodes from an Event Tree

Description

This function removes specified nodes from an event tree, updating edges to maintain the tree structure while ensuring that node IDs remain sequential.

Usage

delete_nodes(
  event_tree_obj,
  nodes_to_delete,
  level_separation = 1000,
  node_distance = 300
)

Arguments

event_tree_obj

A list containing the event tree object, which includes:

  • ⁠$eventtree$x⁠: A list with nodes and edges data frames.

  • ⁠$filtereddf⁠: The data frame used to create the event tree.

nodes_to_delete

A character vector of node IDs to delete from the event tree.

level_separation

Numeric value specifying the spacing between levels in the hierarchical layout. Default is 1000.

node_distance

Numeric value specifying the distance between nodes in the layout. Default is 300.

Details

The function performs the following steps:

Value

A list containing:

Examples

data <- homicides
event_tree <- create_event_tree(data, columns = c(1,2,4,5), "both")
event_tree

updated_tree <- delete_nodes(event_tree, nodes_to_delete = c("s14", "s18"))
updated_tree


[Package stCEG version 0.1.0 Index]