getUnitName: Return UnitNames from the input object

Description Usage Arguments Value Examples

Description

getUnitName returns the UnitNames from input object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
getUnitName(object, CompNames = names(object))

## S4 method for signature 'VNC'
getUnitName(object, CompNames = names(object))

## S4 method for signature 'DD'
getUnitName(object, CompNames = names(object))

## S4 method for signature 'StQ'
getUnitName(object, CompNames = names(object))

Arguments

object

Object whose UnitNames in the slot DD are required.

CompNames

Character vector with the names of components or slots of the object from which the UnitNames are requested.

Value

Returns a character vector with the UnitNames from the components specified in CompNames. If no CompNames parameter is specified, it returns the UnitNames from all the components of the input object.

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
# An example:
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', 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('FF', 3)))

VNC <- BuildVNC(VarList)

getUnitName(VNC)

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