create_sub_tree: Create a Subtree Starting from a Specific Node

View source: R/create_subtree.R

create_sub_treeR Documentation

Create a Subtree Starting from a Specific Node

Description

Constructs a subtree from a specified Node within a given Tree. This subtree encompasses all descendant attributes of the Node.

Usage

create_sub_tree(tree, node_name, avoid_repetition = FALSE)

Arguments

tree

a Tree object from which the subtree is derived.

node_name

A character indicating the name of the starting Node for the subtree.

avoid_repetition

A logical indicating whether to avoid node repetitions. Default is FALSE.

Value

A new Tree object representing the subtree.

See Also

Relevant functions and classes that provide more context or might be of interest:

  • Tree-class: For an in-depth understanding of the Tree class.

  • Node-class: To get more details about the structure of a Node.

Examples

tree <- dexisensitivity::masc2
subtree <- create_sub_tree(masc2, masc2@Nodes[[2]]@Name)
subtree

# Equivalent to :
tree <- dexisensitivity::masc2
subtree <- create_sub_tree(masc2, "Dimension economique")
subtree


dexisensitivity documentation built on Oct. 30, 2024, 1:08 a.m.