variable_mix: Calculate Mix

Description Usage Arguments Value Examples

View source: R/counterfactual_f_part2.R

Description

Calculate Mix

Usage

1
variable_mix(data_input, chosen_period = NA, target_var = NA)

Arguments

data_input

A tibble table with a column date having time information and a column target_var grouping the entries. If no target_var is provided, then specify the name of target_var.

chosen_period

Period where the mix is calculated

target_var

Variable having group information

Value

variable mix returns a summary a pivot table with the mix total

Examples

1
2
3
4
5
data("Sales")
period_mix<-as.Date('2019-01-03')+seq(0,13)
Sales%>%
 filter(year(date)==2019 & week(date) %in% 1:5)%>%
 variable_mix(chosen_period=period_mix,target_var='SALES_CHANNEL')

monkeypostulate/MarketingAnalyticsR documentation built on Feb. 9, 2020, 12:15 a.m.