advbtsub: Using double list to generate sub tree from vector binary...

Description Usage Arguments Value See Also Examples

View source: R/advbtvisit.R

Description

Advanced visiting for the vector binary tree. Generating a sub tree from visited vector binary tree, through specific assigment determined by the argument inq.

Usage

1
advbtsub(x, inq)

Arguments

x

The vector binary tree to be visited. Traversal is acheivable through invalid assignment in desired layers.

inq

An integer double list to determine the visiting location. The length of inq should be the same as the layers of visited vector binary tree. If any assign element in specificed layer exceeds its intrinsic length of visited vector binary tree layer, all elements will be returned in this layer.

Value

Return a sub tree from visited vector binary tree, according to the argument inq.

See Also

vbtinq, vbtsub, advbtinq.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#Make vector binary tree:
colnamevbt <- dl2vbt(chrvec2dl(colnames(datatest)))

#Visit by specific assignment:
visit <- list(c(2), c(3:6), c(2,4), 1)
advbtsub(colnamevbt, visit)

#Traversal of the second layers:
visit <- list(c(2), colnamevbt$dims[2]+1, c(2,4), 1)
advbtsub(colnamevbt, visit)

#Invalid assignments in 1st and 3rd layers:
visit <- list(c(3), c(3:6), c(5), 1)
advbtsub(colnamevbt, visit)

VBTree documentation built on May 2, 2019, 12:39 p.m.