## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
library(naive)

## ----numeric------------------------------------------------------------------
set.seed(1)
x <- data.frame(signal = sin(seq(0, 12, length.out = 120)) + rnorm(120, 0, .05))
fit <- naive_fit(x, seq_len = 8, n_windows = 3, n_samp = 4, seed = 42)
print(fit)
plot(fit)

## ----categorical--------------------------------------------------------------
events <- data.frame(state = factor(rep(c("low", "high", "medium"), 30)))
naive_forecast(events, horizon = 4, seed = 42)$forecast$state

