library(fable) library(tsibble) library(lubridate) library(ggplot2) createPlot <- function(x){ x %>% mutate(time = gsub("\\[|\\]", "", time), time = dmy_hms(time), datehour = floor_date(time, unit = "hour") ) %>% filter(time > ymd_h("2018-08-22 12")) %>% group_by(datehour) %>% summarise(hits = n()) -> apachelog_tidy apachelog_tsbl <- as.tsibble(apachelog_tidy, index = datehour) apachelog_tsbl %>% ARIMA(log(hits)) %>% forecast(h=5) %>% autoplot + ggtitle("Forecasting website hits using apache log only") + xlab("Date time") }