sub_btree: Sub btree

Description Usage Arguments Details Examples

Description

Extract a sub-btree from either an existing btree, or to a specified depth

Usage

1
sub_btree(btree, nodeId = NULL, depth = NULL)

Arguments

btree

A data.table object that is a btree

nodeId

Id of the node which should be the root node in the sub-btree

depth

subset btree by nodes <= this depth

Details

Returns a btree, data.table

Examples

1
2
3
4
library(data.table)
mytree <- make_btree(nodeIds=c(1,2,3,4,5,6,7), parentNodeIds=c(NA,1,1,2,2,3,3))
sub_btree(mytree, nodeId=3)
sub_btree(mytree, depth=1)

ben519/btree documentation built on May 12, 2019, 10:56 a.m.