-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.Rmd
129 lines (88 loc) · 2.9 KB
/
template.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
title: "XXX"
author: "Ben Anderson (b.anderson@soton.ac.uk `@dataknut`)"
date: 'Last run at: `r Sys.time()`'
output:
html_document:
fig_caption: yes
keep_md: yes
number_sections: yes
self_contained: no
toc: yes
toc_float: yes
pdf_document:
toc: yes
bibliography: '`r paste0(findParentDirectory("GREENGrid"), "/bibliography.bib")`'
---
```{r knitrSetup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE) # by default turn off code echo
options(knitr.table.format = 'markdown') # try to fix the tables issue (seems to be pushing html into latex)
```
```{r codeSetup, include=FALSE}
# Set start time ----
startTime <- proc.time()
# Packages needed in this .Rmd file ----
rmdLibs <- c("data.table", # data munching
"dplyr", # data munching
"ggplot2", # for fancy graphs
"readr", # writing to files
"skimr", # for skim
"knitr" # for kable
)
# load them
loadLibraries(rmdLibs)
# run gg set up
nzGREENGrid::setup()
# Local paramaters
ggParams$dataLoc <- paste0(nzGREENGrid::findParentDirectory("nzGREENGrid"), "/data/")
ggParams$figCaption <- paste0("Source: June & December 1998 and June & December 2017 wholesale generation data",
"\nhttps://www.emi.ea.govt.nz/Wholesale/Datasets/Generation/Generation_MD/")
```
If you wish to use any of the material from this report please cite as:
* Anderson, B. (`r 1900 + as.POSIXlt(Sys.Date())$year`) _XXX_, `r ggParams$pubLoc`
This work is (c) `r as.POSIXlt(Sys.time())$year + 1900` the University of Southampton.
\newpage
# About
Report circulation:
* Restricted to: [NZ GREEN Grid](https://www.otago.ac.nz/centre-sustainability/research/energy/otago050285.html) project partners and contractors.
## Purpose
This report is intended to:
* XYZ.
## Requirements:
* ABC
## History
```{r child=ggParams$historyGenericRmd}
```
## Support
```{r child=ggParams$supportGenericRmd}
```
# Introduction
To ...
# Load data
# Analysis
# Discuss your results
here
# Conclusions
go here
# Runtime
```{r check runtime, include=FALSE}
t <- proc.time() - startTime
elapsed <- t[[3]]
```
Analysis completed in `r round(elapsed,2)` seconds ( `r round(elapsed/60,2)` minutes) using [knitr](https://cran.r-project.org/package=knitr) in [RStudio](http://www.rstudio.com) with `r R.version.string` running on `r R.version$platform`.
# R environment
R packages used:
* base R - for the basics [@baseR]
* data.table - for fast (big) data handling [@data.table]
* lubridate - date manipulation [@lubridate]
* ggplot2 - for slick graphics [@ggplot2]
* readr - for csv reading/writing [@readr]
* dplyr - for select and contains [@dplyr]
* progress - for progress bars [@progress]
* knitr - to create this document & neat tables [@knitr]
* nzGREENGrid - for local NZ GREEN Grid project utilities
Session info:
```{r sessionInfo, echo=FALSE}
sessionInfo()
```
# References