Generate competitor media spending as list prices data
generateCompetitorData.Rd
Generate competitor media spending as list prices data
Arguments
- fromDate
the beginning of the time series
- toDate
the end of the time series
- mynames
the names to attach to the generated data
Examples
library(ggplot2)
library(dplyr)
#>
#> Attaching package: ‘dplyr’
#> The following objects are masked from ‘package:stats’:
#>
#> filter, lag
#> The following objects are masked from ‘package:base’:
#>
#> intersect, setdiff, setequal, union
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())