Skip to contents

Generate online media data

Usage

generateOnlineData(
  fromDate = Sys.Date() - 1 * 365,
  toDate = Sys.Date(),
  mynames = c("display", "facebook", "search_branded"),
  avgcpm = 0.5,
  avgnet = 10000
)

Arguments

fromDate

the beginning of the time series

toDate

the end of the time series

mynames

the names to attach to the generated data

avgcpm

the average Cost Per 1000 Impressions

avgnet

the average net investment per insertion and day

Value

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

Examples

library(ggplot2)
library(dplyr)
library(tidyr)
mydflist <- generateOnlineData(Sys.Date() - 30, Sys.Date())
mydflist[["impression"]] %>%
  gather(type, impression, -date) %>%
  ggplot(aes(y = impression, x = date, color = type)) +
  geom_line() +
  theme_minimal()