datavisit: Extract subset of data using different methods

Description Usage Arguments Value See Also Examples

View source: R/datavisit.R

Description

Extract the subset of data by column names using tensor, array, double list, integer vector, or vector binary tree.

Usage

1

Arguments

data

A data.frame with structured column names.

inq

An argument to determine the subset to be extracted by column names. A tensor, array, double list, integer vector and vector binary tree is available format of inq.

Value

Return a list which contains the item index, column name, column coordinate and the data in corresponding column for each element contained in the assignment of inq.

See Also

vbtinq, advbtinq, trvseleinq, trvsidxinq, trvssubinq.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#View the data to be visited:
summary(datatest)
colnames(datatest)

#Structurize colnames of data into vector binary tree:
dl <- chrvec2dl(colnames(datatest))
vbt <- dl2vbt(dl)
vbt

#Setting subset in different forms, for example the pattern
#"Strain-(900~1100)-(0.01, 1)-0.6" is desired:
subunregdl <- list(c(1), c(1:5), c(2,4), c(1)) # undifined double list
subregdl <- advbtinq(vbt, subunregdl) # regularized double list
subvbt <- dl2vbt(subregdl) # sub vector binary tree
subts <- vbt2ts(subvbt) # tensor
subarr <- vbt2arr(subvbt) # array
subchrvec <- as.vector(subarr) # character vector

#Visit the data through different methods:
datavisit(datatest, subunregdl) # by integer vector
datavisit(datatest, subunregdl) # by handmade double list
datavisit(datatest, subregdl) # by defined double list
datavisit(datatest, subvbt) # by vector binary tree
datavisit(datatest, subts) # by tensor
datavisit(datatest, subarr) # by array
datavisit(datatest, subchrvec) # by character vector

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