cm_formula: Create A Calculated Metric Formula

View source: R/cm_formula.R

cm_formulaR Documentation

Create A Calculated Metric Formula

Description

Returns a JSON string formula to be used to build a calculated (derived) metric.

Usage

cm_formula(
  operator = c("divide", "multiply", "subtract", "add"),
  metrics = c("visits", "singlepagevisits"),
  seg_filters = NA,
  rsid = Sys.getenv("AW_REPORTSUITE_ID"),
  company_id = Sys.getenv("AW_COMPANY_ID")
)

Arguments

operator

Formula operators are divide (default), multiply, subtract, or add.

metrics

The one or two metrics in a formula calculation

seg_filters

A vector of segment filters to be added to a metric in the formula

rsid

Adobe report suite ID (RSID). If an environment variable called AW_REPORTSUITE_ID exists in .Renviron or elsewhere and no rsid argument is provided, then the AW_REPORTSUITE_ID value will be used. Use aw_get_reportsuites() to get a list of available rsid values.

company_id

Company ID. If an environment variable called AW_COMPANY_ID exists in .Renviron or elsewhere and no company_id argument is provided, then the AW_COMPANY_ID value will be used. Use get_me() to get a list of available company_id values.

Value

A JSON string formula to be used in a calculated metric


adobeanalyticsr documentation built on Nov. 9, 2023, 5:07 p.m.