vbtinq: Using vector to visit vector binary tree

Description Usage Arguments Value See Also Examples

View source: R/vbtvisit.R

Description

Visit the vector binary tree and return a double list through specific assigment determined by the argument inq.

Usage

1
vbtinq(x, inq)

Arguments

x

The vector binary tree to be visited. Traversal is available by setting -1 in desired layer.

inq

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

Value

Return a double list according to the argument inq.

See Also

vbtsub, advbtinq, advbtsub.

Examples

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

#Visit by specific assignment:
vbtinq(colnamevbt, c(2, 3, 1, 1))

#Traversal of the second layers:
vbtinq(colnamevbt, c(2, -1, 1, 1))

#Invalid assignments in 1st and 3rd layers:
vbtinq(colnamevbt, c(4, 3, 7, 1))

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