expressions: Construct Crunch Expressions

Description Usage Arguments Value

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
## S4 method for signature 'CrunchExpr'
!x

## S4 method for signature 'CategoricalVariable,character'
x %in% table

## S4 method for signature 'CategoricalVariable,factor'
x %in% table

## S4 method for signature 'TextVariable,character'
x %in% table

## S4 method for signature 'NumericVariable,numeric'
x %in% table

## S4 method for signature 'DatetimeVariable,Date'
x %in% table

## S4 method for signature 'DatetimeVariable,POSIXt'
x %in% table

## S4 method for signature 'DatetimeVariable,character'
x %in% table

## S4 method for signature 'CategoricalVariable,numeric'
x %in% table

## S4 method for signature 'CategoricalVariable,numeric'
e1 == e2

## S4 method for signature 'CategoricalVariable,character'
e1 == e2

## S4 method for signature 'CategoricalVariable,factor'
e1 == e2

## S4 method for signature 'CategoricalVariable,numeric'
e1 != e2

## S4 method for signature 'CategoricalVariable,character'
e1 != e2

## S4 method for signature 'CategoricalVariable,factor'
e1 != e2

## S4 method for signature 'CrunchVariable'
is.na(x)

bin(x)

rollup(x, resolution = rollupResolution(x))

rollupResolution(x)

## S4 replacement method for signature 'DatetimeVariable'
rollupResolution(x) <- value

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

for the rollupResolution() setter, the default resolution for this variable.

Value

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


crunch documentation built on Jan. 11, 2019, 1:06 a.m.