Learn R Programming

crunch (version 1.3.2)

expressions: Construct Crunch Expressions

Description

Crunch Expressions, i.e. CrunchExpr and CrunchLogicalExpr, encapuslate 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

## S3 method for class 'CrunchExpr':
as.vector(x, mode = "any")

## S3 method for class 'CrunchExpr': !(x)

## S3 method for class 'CategoricalVariable,character': \%in\%(x, table)

## S3 method for class 'CategoricalVariable,factor': \%in\%(x, table)

## S3 method for class 'TextVariable,character': \%in\%(x, table)

## S3 method for class 'NumericVariable,numeric': \%in\%(x, table)

## S3 method for class 'DatetimeVariable,Date': \%in\%(x, table)

## S3 method for class 'DatetimeVariable,POSIXt': \%in\%(x, table)

## S3 method for class 'CategoricalVariable,numeric': \%in\%(x, table)

## S3 method for class 'CrunchVariable': is.na(x)

bin(x)

rollup(x, resolution = rollupResolution(x))

Arguments

x
an input
mode
For as.vector. Ignored.
table
For %in%. See match
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 appropria

Value

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