BuildVNC: Constructor of objects of class VarNameCorresp

Description Usage Arguments Value Examples

View source: R/BuildVNC.R

Description

This constructor returns an object of class VNC. The input parameter is a named list of objects of class data.table. Notice that the names of this list must be any of 'ID', 'MicroData', 'ParaData', 'Aggregates', 'AggWeights', 'Other' or compound names with these roots (e.g. ParaData_Editing).

Usage

1
2
3
4
5
6
BuildVNC(
  Data = list(ID = data.table(IDQual = character(0), NonIDQual = character(0), IDDD =
    character(0), UnitName = character(0), InFiles = character(0)), MicroData =
    data.table(IDQual = character(0), NonIDQual = character(0), IDDD = character(0),
    UnitName = character(0), InFiles = character(0)))
)

Arguments

Data

A named list of objects of class data.table.

Value

An object of class VarNameCorresp with components specified in the input parameter Data. Components 'ID', 'MicroData' and/or 'ParaData' not being specified are set as an empty data.table.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
library(data.table)
VarList <- list(
  ID = data.table(IDQual = c('NumIdEst', rep('', 4)),
                  NonIDQual = rep('', 5),
                  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, FG', 3)))
                     
VNC <- BuildVNC(VarList)
VNC

#Notice that it is indeed an object with complex structure:
str(VNC)

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