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

Description Usage Arguments Value Examples

Description

[ extracts parts of an object of class StQList.

It is indeed the method [ for the class StQList. This method returns a subset of an input object of class StQList. Thus it returns an object of class StQList.

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 'StQList'

  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 StQList.

i, j, ...

Indices corresponding to the elements to be extracted. These indices are numeric vector or character vector or missing or NULL. Numeric values are coerced internally to integer through as.integer (and thus truncated to zero). Character vector correspond to names of the respective time period of each component object of class StQ.

drop

Included by coherence.

Value

Object of class StQList with the corresponding data subset.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
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 <- new(Class = 'StQList', Data = QList, Periods = newRepoTime(TimePer))
QList[c('MM092015', 'MM102015')]
QList <- StQList(Data = QList, Periods = RepoTime::newRepoTime(TimePer))
QList[c('MM092015', 'MM102015')]

## End(Not run)

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