sub-.VNC: Extract parts of an object of class VNC

Description Usage Arguments Value Examples

Description

[ extracts parts of an object of class VNC.

It is indeed the method [ for the class VNC.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## S3 method for class 'VNC'

  x[
  i,
  j,
  by,
  keyby,
  with = TRUE,
  nomatch = getOption("datatable.nomatch"),
  mult = "all",
  roll = FALSE,
  rollends = if (roll == "nearest") c(TRUE, TRUE) else if (roll >= 0) c(FALSE, TRUE)
    else c(TRUE, FALSE),
  which = FALSE,
  .SDcols,
  verbose = getOption("datatable.verbose"),
  allow.cartesian = getOption("datatable.allow.cartesian"),
  drop = NULL,
  on = NULL
]

Arguments

x

Object of class VNC.

i, j, ...

Indices corresponding to elements to be extracted. The indices are numeric or character vectors, missing or NULL. Numeric values are coerced to integer with as.integer (thus truncated to zero).

drop

Included by coherence.

Value

Object of class VNC with the subsetted 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
## Not run: 
# Falla porque falta un on= en algún join de data.table
# Ademas fallaria al llegar al BuildVNC de esta misma función
library(data.table)
VNC <- VNC(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, FG', 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)))
VNC[c('ID', 'MicroData')]


## End(Not run)

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