Photos
Blog
Projects
vanrenterghem.biz
projects
/
R
/
project-using-kafka-in-R.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Convert to function.
[R/project-using-kafka-in-R.git]
/
predictWebsiteHits.R
diff --git
a/predictWebsiteHits.R
b/predictWebsiteHits.R
index 2a0d66e2e6f96b429a07495d91a92ce5bcb27aba..415ab1eebdedd0c32e88170e91b78bedd866f1b2 100644
(file)
--- a/
predictWebsiteHits.R
+++ b/
predictWebsiteHits.R
@@
-1,15
+1,10
@@
-library(jsonlite)
library(fable)
library(tsibble)
library(lubridate)
library(ggplot2)
library(fable)
library(tsibble)
library(lubridate)
library(ggplot2)
-logfile <- file("data/photos.vanrenterghem.biz.access.kvp.log.1")
-
-apachelog <- stream_in(logfile)
-
-#apachelog$time <- gsub("\\[|\\]", "", apachelog$time)
-apachelog %>%
+createPlot <- function(x){
+x %>%
mutate(time = gsub("\\[|\\]", "", time),
time = dmy_hms(time),
datehour = floor_date(time, unit = "hour")
mutate(time = gsub("\\[|\\]", "", time),
time = dmy_hms(time),
datehour = floor_date(time, unit = "hour")
@@
-26,4
+21,4
@@
apachelog_tsbl %>%
autoplot +
ggtitle("Forecasting website hits using apache log only") +
xlab("Date time")
autoplot +
ggtitle("Forecasting website hits using apache log only") +
xlab("Date time")
-
+}
\ No newline at end of file