Skip to contents

Generate offline media data

Usage

generateEventData(
  fromDate = Sys.Date() - 1 * 365,
  toDate = Sys.Date(),
  mynames = c("event_a", "event_b"),
  freq = 0.01
)

Arguments

fromDate

the beginning of the time series

toDate

the end of the time series

mynames

the names to attach to the generated data

freq

the rate of incidence of events

Value

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

Examples

library(ggplot2)
library(dplyr)
library(tidyr)
generateEventData(Sys.Date() - 30, Sys.Date()) %>%
  gather(type, value, -date) %>%
  ggplot(aes(y = value, x = date, color = type)) +
  geom_line() +
  theme_minimal()