plus-.StQ: Method '+' for the class StQ

Description Usage Arguments Value Examples

Description

+ joins two objects of class StQ in a single object of the same class.

This method overloads the operator + and builds a new StQ object combining both input objects.

Usage

1
2
## S3 method for class 'StQ'
e1 + e2

Arguments

e1

Object of class StQ.

e2

Object of class StQ.

Value

Object of class StQ with the join of both slots DD and Data.

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
27
28
# We build a trivial data set:
library(data.table)

Data1 <- data.table(ID = c('002', '003', '004'),
                    IDDD = c('NewOrders', 'NewOrders', 'NewOrders'),
                    Value = c(32150, 12574, 23896))
VNC1 <- data.table(IDQual = c('ID', ''),
                   NonIDQual = c('', ''),
                   IDDD = c('', 'NewOrders'),
                   ID = c('', '.'),
                   UnitName = c('numidest', 'cp01'),
                   InFiles = rep('FF', 2))
VNC1 <- BuildVNC(list(MicroData = VNC1))

MicroDD1 <- data.table(Variable = c('ID', 'NewOrders'),
                       Sort = c('IDQual', 'IDDD'),
                       Class = c('character', 'numeric'),
                       Length = c('11', '7'),
                       Qual1 = c('', 'ID'),
                       ValueRegExp = c('[0-9]{9}PP', '([0-9]{1, 10}| )'))
DD1 <- DD(VNC = VNC1, MicroData = MicroDD1)

# We build the StQ object, and join it with another previously created in a
#  single object:
data(ExampleStQ)  
Q1 <- StQ(Data = Data1, DD = DD1)
Q2 <- ExampleStQ
Q1 + Q2

david-salgado/StQ documentation built on Aug. 12, 2021, 3:23 p.m.