Skip to contents

Generate macro economical data

Usage

generateMacroData(
  fromDate = Sys.Date() - 1 * 365,
  toDate = Sys.Date(),
  mynames = c("cpi", "cci", "gdp")
)

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

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


ts.plot(arima.sim(list(order = c(1, 1, 0), ar = 0.7), n = 365))