Description Usage Arguments Value Examples
IDDDToUnitNames
returns a character vector with the production unit variable
name for each IDDD variable name.
1 2 3 4 5 6 7 | IDDDToUnitNames(IDDDNames, object)
## S4 method for signature 'character,DD'
IDDDToUnitNames(IDDDNames, object)
## S4 method for signature 'character,StQ'
IDDDToUnitNames(IDDDNames, object)
|
IDDDNames |
Character vector with the IDDD variables. |
object |
Object with the IDDD variable identifiers (of class DD or StQ). |
Character
vector with the production unit names and their corresponding IDDD
variable names as the names of the vector.
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 62 63 64 65 66 67 68 69 | library(data.table)
### We build the VNC object
VarList <- list(ID = data.table(IDQual = c('NumIdEst', rep('', 4)),
NonIDQual = c('','','','',''),
IDDD = c('', 'Name', 'Surname', 'PostalAddr', 'PhoneNo'),
NumIdEst = c('', rep('.', 4)),
UnitName = c('numidest', 'nombre', 'apellidos', 'direccion', 'telefono'),
InFiles = rep('FI', 5)),
MicroData = data.table(IDQual = c('NumIdEst', rep('', 2)),
NonIDQual = c('', 'Market', ''),
IDDD = c(rep('', 2), 'NewOrders'),
NumIdEst = c(rep('', 2), '.'),
Market = c(rep('', 2), '1.'),
UnitName = c('numidest', '', 'cp09'),
InFiles = rep('FF, FD, FA', 3)),
ParaData = data.table(IDQual = c('NumIdEst', rep('', 2)),
NonIDQual = c('', 'Action', ''),
IDDD = c(rep('', 2), 'Date'),
NumIdEst = c(rep('', 2), '.'),
Action = c(rep('', 2), 'Imputation'),
UnitName = c('numidest', '', 'FechaImput'),
InFiles = rep('FP', 3)),
AggWeights = data.table(IDQual = c('CCAA', 'NACE09', ''),
NonIDQual = rep('', 3),
IDDD = c('', '', 'Ponderacion'),
CCAA = c('', '', '.'),
NACE09 = c('', '', '.'),
UnitName = c('Provincia', '', ''),
InFiles = rep('FA', 3)))
VNC <- BuildVNC(VarList)
### We build the specification data.tables
IDdt <- data.table(
Variable = c('NumIdEst', 'Name', 'Surname', 'PostalAddr', 'PhoneNo'),
Sort = c('IDQual', rep('IDDD', 4)),
Class = rep('character', 5),
Length = c('11', '15', '15', '20','9'),
Qual1 = c('', rep('NumIdEst', 4)),
ValueRegExp = c('[0-9]{9}PP', '.+', '.+', '.+', '(6|9)[0-9]{8}'))
Microdt <- data.table(
Variable = c('NumIdEst', 'Market', 'NewOrders'),
Sort = c('IDQual', 'NonIDQual', 'IDDD'),
Class = c(rep('character', 2), 'numeric'),
Length = c('11', '2', '7'),
Qual1 = c(rep('', 2), 'NumIdEst'),
ValueRegExp = c('[0-9]{9}PP', '.+', '([0-9]{1, 10}| )'))
Paradt <- data.table(
Variable = c('NumIdEst', 'Action', 'Date'),
Sort = c('IDQual', 'NonIDQual', 'IDDD'),
Class = rep('character', 3),
Length = c('11', '10', '10'),
Qual1 = c(rep('', 2), 'NumIdEst'),
Qual2 = c(rep('', 2), 'Action'),
ValueRegExp = c('[0-9]{9}PP', 'Collection|Editing|Imputation',
'(([0-9]{2}-(0[1-9]|1(0-2))-[0-9]{4})| )'))
Aggdt <- data.table(Variable = c('CCAA', 'NACE09', 'Ponderacion'),
Sort = c(rep('IDQual', 2), 'IDDD'),
Class = c(rep('character', 2), 'numeric'),
Length = c('2', '4', '7'),
Qual1 = c(rep('', 2), 'CCAA'),
Qual2 = c(rep('', 2), 'NACE09'),
ValueRegExp = c('[0-9]{4}', '([0-4][0-9])|(5[0-2])',
'([0-9]{1, 15}| )'))
DD <- BuildDD(list(VNC = VNC, ID = IDdt, MicroData = Microdt, ParaData = Paradt, Aggregates = Aggdt))
IDDDToUnitNames('Date_Imputation', DD)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.