getData: Return slot 'Data' from an object possibly subsetted to a set...

Description Usage Arguments Value Examples

Description

getData returns slot Data from the input object possibly subsetted to those variables specified as an input parameter.

Input objects can be of class:

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
getData(object, VarNames)

## S4 method for signature 'StQ'
getData(object, VarNames)

## S4 method for signature 'rawStQ'
getData(object, VarNames)

## S4 method for signature 'StQList'
getData(object, VarNames)

## S4 method for signature 'rawStQList'
getData(object, VarNames)

Arguments

object

Object whose (possibly subsetted) slot Data is queried.

VarNames

Character vector with the variable names subsetting the data set.

Value

In the case of StQ/rawStQ objects, it returns a data.table with key-value pair structure corresponding to slot Data from the input object with the values of the variables restricted to variable names specified in VarNames. In the case of StQList/rawStQList objects, it returns a list of StQ/linkS4classrawStQ objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# From an StQ object
VarNames <- c('Employees_1.')
getData(ExampleStQ, VarNames)

VarNames <- c('Turnover')
getData(ExampleStQ, VarNames)

# From a rawStQ object
VarNames <- c('Turnover')
getData(ExamplerawStQ, VarNames)

# From an StQList object
mm <- c(paste0('0', 1:9), 10:12)
TimePer <- paste0('MM', mm, '2015')
QList <- vector('list', 12)
QList <- lapply(QList, function(x) ExampleStQ)
names(QList) <- TimePer
QList <- BuildStQList(QList)
VarNames <- c('Turnover', 'Employees_1.')
getData(QList, VarNames)

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