rt_campaign_add_path_id: adds '.path_id' column to dataframe. Each conversion step...

View source: R/attribution.R

rt_campaign_add_path_idR Documentation

adds '.path_id' column to dataframe. Each conversion step triggers a new path-id for subsequent steps

Description

adds '.path_id' column to dataframe. Each conversion step triggers a new path-id for subsequent steps

Usage

rt_campaign_add_path_id(
  .campaign_data,
  .id = "id",
  .timestamp = "timestamp",
  .num_conversions = "num_conversions",
  .conversion_value = "conversion_value",
  .use_first_conversion = TRUE,
  .sort = TRUE
)

Arguments

.campaign_data

dataframe with columns: 'id | timestamp | step | num_conversions | conversion_value'

.id

string identifying the id column

.timestamp

string identifying the timestamp column

.num_conversions

string identifying the num_conversions column

.conversion_value

string identifying the conversion_values column

.use_first_conversion

if true, only use the first conversion - the path id will be identical to the .id (by definition there will never be more than 1 path)

.sort

if true, the df is sorted by id, timestamp, conversion_values, & num_conversions; the dataframe needs to be sorted in this way to work, but this option let's the user avoid this action if it has already been done


shane-kercheval/rtools documentation built on July 7, 2022, 8:31 a.m.