generateCompetitorData: Generate competitor media spending as list prices data

Description Usage Arguments Value Examples

View source: R/datagen.R

Description

Generate competitor media spending as list prices data

Usage

1
2
3
4
5
generateCompetitorData(
  fromDate = Sys.Date() - 1 * 365,
  toDate = Sys.Date(),
  mynames = c("competitor_a", "competitor_b", "competitor_c")
)

Arguments

fromDate

the beginning of the time series

toDate

the end of the time series

mynames

the names to attach to the generated data

Value

a tibble with the generated data one column for each element in name

Examples

1
2
3
4
5
6
7
library(ggplot2)
library(dplyr)
library(tidyr)
generateCompetitorData(Sys.Date() - 30, Sys.Date()) %>%
  gather(competitor, spend, -date) %>%
  ggplot(aes(y = spend, x = date, fill = competitor)) +
  geom_bar(stat = "identity", position = position_stack())

DoktorMike/dammmdatagen documentation built on Dec. 29, 2021, 6:46 a.m.