setMicroData: Set value of slot 'MicroData' of an object DD

Description Usage Arguments Value Examples

Description

setMicroData assigns a data.table to the slot ID of the input object.

Usage

1
2
3
4
5
6
7
setMicroData(object) <- value

## S4 replacement method for signature 'VNC,data.table'
setMicroData(object) <- value

## S4 replacement method for signature 'DD,data.table'
setMicroData(object) <- value

Arguments

object

Object containing slot ID to be assigned.

value

data.table to be assigned to the slot ID.

Value

Object DD with slot ID updated.

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
## Not run: 
library(data.table)
MicroDataDD <- data.table(Variable = 'NewOrders', Sort = 'IDDD', Class = 'numeric',
                          Length = '8',
                          Qual1 = 'NumIdEst', Qual2 = 'Market', ValueRegExp = '')
VarList <- list(MicroData = data.table(IDQual = c('NumIdEst','','',''),
                                       NonIDQual = c('', 'Market', 'Cod', ''),
                                       IDDD = c('', '', '' , 'NewOrders'),
                                       NumIdEst = c('', '', '', '.'),
                                       Market = c('', '', '', '1.'),
                                       Cod = rep('', 4),
                                       UnitName = c('', '', '', 'cp02'),
                                       InFiles = rep('FF', 4)))
VNC <- BuildVNC(VarList)
DD <- DD(VNC = VNC, MicroData = MicroDataDD)

Microdt <- data.table(Variable = c('NumIdEst', 'NewOrders', 'Turnover'),
                      Sort = c('IDQual', 'IDDD', 'IDDD'),
                      Class = c('character', 'numeric', 'numeric'),
                      Length = c('11', '8', '8'),
                      Qual1 = c('', 'NumIdEst', 'NumIdEst'),
                      ValueRegExp = c('[0-9]{9}PP', '([0-9]{1, 10}| )', '([0-9]{1, 10}| )'))
setMicroData(DD) <- Microdt
DD

## End(Not run)

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