Learn R Programming

zoocat (version 0.2.0.1)

filter_col: Return columns with matching conditions

Description

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

Usage

filter_col_q(x, ...)

filter_col(x, ...)

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

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

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

# S3 method for zoomly filter_col(x, cond = NULL, 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.

Value

a "zoocat" or "zoomly" object.

Details

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

Examples

Run this code
# NOT RUN {
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))

# }

Run the code above in your browser using DataLab