filter_col: Return columns with matching conditions

Description Usage Arguments Details Value Examples

Description

Return columns with matching conditions for the column attributes (cattr) table.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
filter_col_q(x, ...)

filter_col(x, ...)

## S3 method for class 'zoocat'
filter_col_q(x, cond, ...)

## S3 method for class 'zoocat'
filter_col(x, cond, ...)

## S3 method for class 'zoomly'
filter_col_q(x, cond, mon.repro = NULL, ...)

## S3 method for class 'zoomly'
filter_col(x, cond, mon.repro = NULL, ...)

Arguments

x

the object.

...

other arguments.

cond

logical predicates of conditions. Multiple conditions are combined with &. For filter_col, cond must be an expression, while for filter_col_q, cond must be a quoted expression.

mon.repro

the reprocessing month vector, which is used for reprocess_month. See details.

Details

For filter_col, when the argument mon.repro is not NULL, reprocess_month will be called in the last step.

Value

a "zoocat" or "zoomly" object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
x <- matrix(1 : 20, nrow = 5)
colAttr <- data.frame(month = c(2, 3, 5, 6), name = c(rep('xxx', 3), 'yyy'))
zc <- zoocat(x, order.by = 1991 : 1995, colattr = colAttr)
filter_col(zc, month > 2)
filter_col(zc, month > 2)
filter_col(zc, month > 2 & name == 'yyy')

mat <- matrix(1:48, ncol = 12)
colAttr <- data.frame(month = rep(1 : 12))
zm <- zoomly(mat, order.by = 1991 : 1994, colattr = colAttr)
filter_col(zm, mon.repro = 1 : 3)
filter_col(zm, mon.repro = c(-9 : 8))
filter_col(zm, cond = month %in% 1 : 3, mon.repro = c(-24 : 3))

ran-ran/zoocat documentation built on May 26, 2019, 10:56 p.m.