path_to_root: Extract a path from node to root.

Description Usage Arguments Details Value Examples

View source: R/tree_routines.R

Description

Identifies the nodes on the path from a node up to the root of a TreeHarp object.

Usage

1
path_to_root(th, node_num)

Arguments

th

A TreeHarp object.

node_num

A node number to start tracking upwards from.

Details

This function allows the user to identify the branch from a node up to the root of a tree.

Value

A vector of 1's and 0's that can be used to carve out the branch alone, using carve_subtree.

Examples

1
2
3
ex1 <- quote(x <- f(y, g(5)))
th1 <- TreeHarp(ex1, TRUE)
path_to_root(th1, 5)

autoharp documentation built on Nov. 13, 2021, 1:06 a.m.