Learn R Programming

ganalytics (version 0.10.7)

Expr: Expr

Description

Define a Google Analytics expression.

Usage

Expr(object, comparator, operand, metricScope = "")

# S4 method for .expr,ANY Expr(object)

# S4 method for formula,ANY Expr(object, metricScope)

# S4 method for character,character Expr(object, comparator, operand, metricScope = "")

Arguments

object

A dimension or metric variable, or another object to be coerced to an .expr object.

comparator

The comparator to use for the expression.

operand

The operand to use for the expression.

metricScope

Optional scope to use in the case of metric variables for segmentation. Possible values include "perUser" or "perSession".

Methods (by class)

  • object = .expr,comparator = ANY: Returns itself.

  • object = formula,comparator = ANY: Use non-standard formula evaluation to define an expression. Accepts a formula in the form of: ~ <variable> <comparator> <operand> where only the <operand> is evaluated.

  • object = character,comparator = character: Return an expression composed of the supplied variable, comparator and operand arguments.

See Also

Other expression generators: GaExpr, McfExpr, RtExpr

Examples

Run this code
# NOT RUN {
source_google <- Expr(~source == "google")
source_google <- Expr("source", "==", "google")
bounces <- Expr("bounces", ">", 0)
# }

Run the code above in your browser using DataLab