Learn R Programming

crunch (version 1.20.0)

expressions: Construct Crunch Expressions

Description

Crunch Expressions, i.e. CrunchExpr and CrunchLogicalExpr, encapsulate derivations of Crunch variables, which are only evaluated when passed to a function like as.vector. They allow you to compose functional expressions of variables and evaluate them against the server only when appropriate.

Usage

# S4 method for CrunchExpr
!(x)

# S4 method for CategoricalVariable,character %in%(x, table)

# S4 method for CategoricalVariable,factor %in%(x, table)

# S4 method for TextVariable,character %in%(x, table)

# S4 method for NumericVariable,numeric %in%(x, table)

# S4 method for DatetimeVariable,Date %in%(x, table)

# S4 method for DatetimeVariable,POSIXt %in%(x, table)

# S4 method for DatetimeVariable,character %in%(x, table)

# S4 method for CategoricalVariable,numeric %in%(x, table)

# S4 method for CategoricalVariable,character ==(e1, e2)

# S4 method for CategoricalVariable,factor ==(e1, e2)

# S4 method for CategoricalVariable,character !=(e1, e2)

# S4 method for CategoricalVariable,factor !=(e1, e2)

# S4 method for CrunchVariable is.na(x)

bin(x)

rollup(x, resolution = rollupResolution(x))

Arguments

x

an input

table

For %in%. See base::match()

e1

an input

e2

an input

resolution

For rollup. Either NULL or a character in c("Y", "Q", "M", "W", "D", "h", "m", "s", "ms") indicating the unit of time at which a Datetime variable should be aggregated. If NULL, the server will determine an appropriate resolution based on the range of the data.

Value

Most functions return a CrunchExpr or CrunchLogicalExpr. as.vector returns an R vector.