From 895a592f3758fa4f40dd703dc37ab2f0d5c6ff22 Mon Sep 17 00:00:00 2001
From: Ben Anderson <b.anderson@soton.ac.uk>
Date: Tue, 30 Jun 2020 10:12:10 +0100
Subject: [PATCH] added example drake retrieval

---
 Rmd/make_basicReport.R | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Rmd/make_basicReport.R b/Rmd/make_basicReport.R
index ed3acb6..8013647 100644
--- a/Rmd/make_basicReport.R
+++ b/Rmd/make_basicReport.R
@@ -66,7 +66,7 @@ startTime <- proc.time()
 # Set the drake plan ----
 # Clearly this will fail if you do not have internet access...
 plan <- drake::drake_plan(
-  esoData = getData(urlToGet, update), # returns data as data.table. If you edit update in any way it will reload - drake is watching you!
+  esoData = getData(urlToGet, update), # returns data as data.table. If you edit 'update' in any way it will reload - drake is watching you!
   skimTable = skimr::skim(esoData), # create a data description table
   gWPlot = makeGWPlot(esoData) # make a plot
 )
@@ -80,6 +80,10 @@ make(plan) # run the plan, re-loading data if needed
 # drake can't seem to track the .rmd file if it is not explicitly named
 makeReport(rmdFile)
 
+# Just to show we can bring spirits back from the deep (i.e. from wherever drake hid them)
+dt <- drake::readd(esoData)
+message("Data covers ", min(dt$rDateTime), " to ", max(dt$rDateTime))
+
 # Finish off ----
 
 t <- proc.time() - startTime # how long did it take?
-- 
GitLab