setVNC: Set value of slot VarNameCorresp

Description Usage Arguments Value Examples

Description

setVNC assigns a VarNameCorresp object to the slot VarNameCorresp of the input object.

Usage

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

## S4 replacement method for signature 'DD,VNC'
setVNC(object) <- value

## S4 replacement method for signature 'StQ,VNC'
setVNC(object) <- value

Arguments

object

Object containing slot VarNameCorresp to be set.

value

Object of class VarNameCorresp.

Value

Object with slot VarNameCorresp 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# On an object of class DD:
library(data.table)
MicroDataDD <- data.table(Variable = 'IEPEntradaPed', 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('', '', '' ,'IEPEntradaPed'),
                                       NumIdEst = c('', '', '', '.'),
                                       Market = c('', '', '', '1.'),
                                       Cod = rep('', 4),
                                       UnitName = c('', '', '', 'cp02'),
                                       InFiles = rep('FF', 4)))
VNC <- BuildVNC(VarList)
DD <- DD(list(VNC = VNC, MicroData = MicroDataDD))

VarListAdd <- list(MicroData = data.table(IDQual = c('NumIdEst','','',''),
                                          NonIDQual = c('','Market','Cod', ''),
                                          IDDD = c('', '', '' , 'IEPEntradaPed'),
                                          NumIdEst = c('', '', '', '.'),
                                          Market = c('', '', '', '2.'),
                                          Cod = rep('', 4),
                                          UnitName = c('', '', '', 'cp02'),
                                          InFiles = rep('FF', 4)))
VNCAdd <- BuildVNC(VarListAdd)
setVNC(DD) <- VNCAdd
DD

## Not run: 
# On an object of class StQ:
library(data.table)
MicroDataDD <- data.table(Variable = 'IEPEntradaPed', Sort = 'IDDD', Class = 'numeric',
                          Length = '8', Qual1 = 'NOrden', ValueRegExp = '')
MicroDataDD <- new(Class = 'DDdt', MicroDataDD)
VarList <- list(MicroData = new(Class = 'VNCdt', data.table(IDQual = c('NumIdEst','','',''),
                                                          NonIDQual = c('', 'Market', 'Cod', ''),
                                                          IDDD = c('', '', '' ,'IEPEntradaPed'),
                                                          NumIdEst = c('', '', '', '.'),
                                                          Market = c('', '', '', '1.'),
                                                          Cod = rep('', 4),
                                                          UnitName = c('', '', '', 'cp02'),
                                                          InFiles = rep('FF', 4))))
VNC <- BuildVNC(VarList)
DD <- new(Class = 'DD', VarNameCorresp = VNC, MicroData = MicroDataDD)  
StQ <- new(Class = 'StQ', Data = new(Class = 'Datadt',
                                     data.table(IDDD = character(0), Value = character(0))),
                          DD = DD)
             
VarListAdd <- list(MicroData = new(Class = 'VNCdt', data.table(IDQual = c('NumIdEst','','',''),
                                                          NonIDQual = c('','Market','Cod', ''),
                                                          IDDD = c('', '', '' , 'IEPEntradaPed'),
                                                          NumIdEst = c('', '', '', '.'),
                                                          Market = c('', '', '', '2.'),
                                                          Cod = rep('', 4),
                                                          UnitName = c('', '', '', 'cp02'),
                                                          InFiles = rep('FF', 4))))
VNCAdd <- BuildVNC(VarListAdd)                                                    
setVNC(StQ) <- VNCAdd
getDD(StQ)

## End(Not run)

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