Learn R Programming

autoharp (version 0.0.13)

path_to_root: Extract a path from node to root.

Description

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

Usage

path_to_root(th, node_num)

Value

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

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.

Examples

Run this code
ex1 <- quote(x <- f(y, g(5)))
th1 <- TreeHarp(ex1, TRUE)
path_to_root(th1, 5)

Run the code above in your browser using DataLab