From 82bd1384aad2d4af17e48bc597e664176211b055 Mon Sep 17 00:00:00 2001 From: "T.W.Rushby" <twr1m15@srv02405.soton.ac.uk> Date: Mon, 20 Jul 2020 16:42:38 +0100 Subject: [PATCH] Add bookdown as reqd package for makeReport to work. Remove version from makeReport to fix function. --- Rmd/make_basicReport.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Rmd/make_basicReport.R b/Rmd/make_basicReport.R index c10725c..12e2ef9 100644 --- a/Rmd/make_basicReport.R +++ b/Rmd/make_basicReport.R @@ -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 ) } -- GitLab