Skip to content
Snippets Groups Projects
Commit 82bd1384 authored by T.W.Rushby's avatar T.W.Rushby Committed by Tom Rushby
Browse files

Add bookdown as reqd package for makeReport to work. Remove version from...

Add bookdown as reqd package for makeReport to work. Remove version from makeReport to fix function.
parent e58122c0
Branches
No related tags found
No related merge requests found
......@@ -9,7 +9,8 @@ reqLibs <- c("data.table", # data munching
"here", # here
"lubridate", # dates and times
"ggplot2", # plots
"skimr" # for skim
"skimr", # for skim
"bookdown" # for making reports (should also install knittr etc)
)
# load them
woRkflow::loadLibraries(reqLibs)
......@@ -41,7 +42,7 @@ makeGWPlot <- function(dt){
dt[, weekDay := lubridate::wday(rDateTime, label = TRUE)]
# draw a megaplot for illustrative purposes
p <- ggplot2::ggplot(dt, aes(x = rDateTime,
y = GENERATION/1000000,
y = GENERATION/1000,
colour = weekDay)) +
geom_point() +
theme(legend.position = "bottom") +
......@@ -51,13 +52,13 @@ makeGWPlot <- function(dt){
return(p)
}
version <- 10
makeReport <- function(f,version){
makeReport <- function(f){
# default = html
rmarkdown::render(input = paste0(here::here("Rmd", f),".Rmd"), # we love here:here() - it helps us find the .Rmd to use
params = list(title = title,
subtitle = subtitle,
authors = authors),
output_file = paste0(here::here("docs", f),version,".html") # where the output goes
output_file = paste0(here::here("docs", f),".html") # where the output goes
)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment