Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
woRkflow
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SERG
woRkflow
Commits
bf28fd44
Commit
bf28fd44
authored
5 years ago
by
B.Anderson
Browse files
Options
Downloads
Patches
Plain Diff
minor changes
parent
669144c1
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Rmd/make_basicReport.R
+10
-6
10 additions, 6 deletions
Rmd/make_basicReport.R
docs/basicReport.html
+50
-1366
50 additions, 1366 deletions
docs/basicReport.html
with
60 additions
and
1372 deletions
Rmd/make_basicReport.R
+
10
−
6
View file @
bf28fd44
...
...
@@ -41,7 +41,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
/
1000
,
y
=
GENERATION
/
1000
000
,
colour
=
weekDay
))
+
geom_point
()
+
theme
(
legend.position
=
"bottom"
)
+
...
...
@@ -50,16 +50,17 @@ makeGWPlot <- function(dt){
caption
=
"Source: UK Grid ESO (http://data.nationalgrideso.com)"
)
return
(
p
)
}
makeReport
<-
function
(
f
){
version
<-
1.0
makeReport
<-
function
(
f
,
version
){
# 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
),
".html"
)
# where the output goes
output_file
=
paste0
(
here
::
here
(
"docs"
,
f
),
version
,
".html"
)
# where the output goes
)
}
# Set up ----
startTime
<-
proc.time
()
...
...
@@ -73,16 +74,19 @@ plan <- drake::drake_plan(
# Run drake plan ----
plan
# test the plan
make
(
plan
)
# run the plan, re-loading data if needed
# Run the report ----
# run the report - don't do this inside the drake plan as
# drake can't seem to track the .rmd file if it is not explicitly named
#
makeReport(rmdFile)
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
))
dt
[,
rDateTimeUTC
:=
lubridate
::
as_datetime
(
DATETIME
)]
message
(
"Data covers "
,
min
(
dt
$
rDateTimeUTC
),
" to "
,
max
(
dt
$
rDateTimeUTC
))
# Finish off ----
...
...
This diff is collapsed.
Click to expand it.
docs/basicReport.html
+
50
−
1366
View file @
bf28fd44
Source diff could not be displayed: it is too large. Options to address this:
view the blob
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment