trvssubinq: Using sub vector binary tree to visit the traversal table

View source: R/trvsvisit.R

trvssubinqR Documentation

Using sub vector binary tree to visit the traversal table

Description

Visit the traversal table generated from a vector binary tree through the sub vector binary tree determined by the argument inq, and return an inquiry list containing the numeric index, the character pattern and the corresponding coordinate for each item.

Usage

trvssubinq(trvs, inq)

Arguments

trvs

The traversal table to be visited, which should be generated from the vector binary tree by the function trvs().

inq

A sub tree generated from the original vector binary tree, to determine the subset of elements to be visited.

Value

Return a list containing the numeric index, the character pattern and the corresponding coordinate for each item.

See Also

vbtsub, advbtsub.

Examples

#Make original vector binary tree and its traversal table:
vbt <- dl2vbt(chrvec2dl(colnames(datatest)))
trav <- trvs(vbt)

#Visit all elements defined by sub vector binary tree:
#example 1: visit all "Stress-*-*-*" patterns;
#make sub vector binary tree through vbtsub() then execute inquiry:
subvbt <- vbtsub(vbt, c(2,-1,-1,-1))
trvssubinq(trav, subvbt)

#example 2: visit all "Strain-("950", "1050")-("0.001", "0.1")-*" patterns;
#make sub vector binary tree through advbtsub() then execute inquiry:
subvbt <- advbtsub(vbt, list(1, c(2,4), c(1,3), 1))
trvssubinq(trav, subvbt)

CubicZebra/VBTree documentation built on Feb. 3, 2024, 3:42 p.m.