1 A basic .Rmd template to illustrate our workflow

1.1 Data

The following uses skimr::skim() to describe the data. Remember we created the skim output object in the R script. We just report it here.

Table 1.1: Data summary
Name esoData
Number of rows 201790
Number of columns 34
_______________________
Column type frequency:
character 1
factor 1
numeric 31
POSIXct 1
________________________
Group variables None

Variable type: character

skim_variable n_missing complete_rate min max empty n_unique whitespace
DATETIME 0 1 19 19 0 201790 0

Variable type: factor

skim_variable n_missing complete_rate ordered n_unique top_counts
weekDay 0 1 TRUE 7 Thu: 28848, Fri: 28848, Sat: 28848, Sun: 28846

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
GAS 0 1 12739.94 5272.46 1556.0 8609.0 12867.0 16841.00 27472.0 ▃▆▇▅▁
COAL 0 1 8051.56 6596.52 0.0 1565.0 7126.0 13398.75 26044.0 ▇▃▅▂▁
NUCLEAR 0 1 7093.11 1048.96 3705.0 6398.0 7250.0 7894.00 9342.0 ▁▂▆▇▃
WIND 0 1 3237.05 3193.43 0.0 812.0 2188.0 4750.00 17129.0 ▇▃▁▁▁
HYDRO 0 1 396.56 245.98 0.0 193.0 366.0 565.00 1403.0 ▇▇▅▁▁
IMPORTS 0 1 1978.97 1100.63 0.0 1160.0 2014.0 2942.00 4884.0 ▅▅▇▆▁
BIOMASS 0 1 447.68 867.07 0.0 0.0 0.0 0.00 3204.0 ▇▁▁▁▁
OTHER 0 1 528.53 681.31 0.0 0.0 121.0 830.00 2456.0 ▇▂▂▁▁
SOLAR 0 1 648.10 1465.86 0.0 0.0 0.0 377.00 9680.0 ▇▁▁▁▁
STORAGE 0 1 309.39 348.68 0.0 0.0 294.0 452.00 2660.0 ▇▂▁▁▁
GENERATION 0 1 35430.89 7453.15 18287.0 29669.0 35346.0 40604.00 59500.0 ▃▇▇▃▁
CARBON_INTENSITY 0 1 387.85 140.17 54.0 263.0 403.0 508.00 695.0 ▂▆▆▇▂
LOW_CARBON 0 1 11822.50 4095.75 4626.0 8808.0 10752.0 14092.00 30746.0 ▇▇▃▁▁
ZERO_CARBON 0 1 11374.82 3644.35 4626.0 8702.0 10477.0 13484.00 28473.0 ▇▇▃▁▁
RENEWABLE 0 1 4281.71 3759.08 0.0 1288.0 3154.0 6304.00 23118.0 ▇▃▁▁▁
FOSSIL 0 1 20791.50 8826.64 1899.0 14075.0 20080.5 27050.75 49096.0 ▃▇▇▃▁
GAS_perc 0 1 35.52 12.24 5.0 26.4 36.4 45.00 70.1 ▂▆▇▆▁
COAL_perc 0 1 21.31 15.93 0.0 4.6 20.9 35.50 60.6 ▇▅▅▅▁
NUCLEAR_perc 0 1 20.87 5.24 9.2 17.0 20.1 24.00 43.1 ▃▇▃▁▁
WIND_perc 0 1 9.64 9.86 0.0 2.3 6.3 13.90 60.3 ▇▂▁▁▁
HYDRO_perc 0 1 1.10 0.64 0.0 0.6 1.0 1.50 4.2 ▇▇▃▁▁
IMPORTS_perc 0 1 6.00 3.65 0.0 3.2 6.2 8.60 18.9 ▆▇▆▂▁
BIOMASS_perc 0 1 1.39 2.73 0.0 0.0 0.0 0.00 16.1 ▇▁▁▁▁
OTHER_perc 0 1 1.58 2.10 0.0 0.0 0.4 2.60 10.5 ▇▂▁▁▁
SOLAR_perc 0 1 1.81 4.19 0.0 0.0 0.0 1.00 32.8 ▇▁▁▁▁
STORAGE_perc 0 1 0.78 0.84 0.0 0.0 0.7 1.20 7.9 ▇▁▁▁▁
GENERATION_perc 0 1 100.00 0.00 100.0 100.0 100.0 100.00 100.0 ▁▁▇▁▁
LOW_CARBON_perc 0 1 34.80 13.79 10.7 24.2 31.9 42.60 87.9 ▆▇▃▁▁
ZERO_CARBON_perc 0 1 33.42 12.35 10.7 24.0 31.1 40.40 85.1 ▆▇▃▁▁
RENEWABLE_perc 0 1 12.55 11.27 0.0 3.7 9.1 18.40 66.2 ▇▃▁▁▁
FOSSIL_perc 0 1 56.84 16.25 7.6 45.7 58.6 70.10 88.0 ▁▃▆▇▅

Variable type: POSIXct

skim_variable n_missing complete_rate min max median n_unique
rDateTime 0 1 2009-01-01 2020-07-05 22:30:00 2014-10-03 23:15:00 201790

There's quite a lot of data...

1.2 Plot

1.1 plots every data point in the data (!). Remember we created the plot output object in the R script. We just print it here.

<<<<<<< HEAD Half-hourly generation (GW) ======= Half-hourly generation (GW) >>>>>>> 9c8efd5bc4ce0204cb88234db1734f4656a07633

Figure 1.1: Half-hourly generation (GW)

<<<<<<< HEAD

2 Runtime

Report generated in 33.71 seconds ( 0.56 minutes) using knitr in RStudio with R version 3.6.0 (2019-04-26) running on x86_64-redhat-linux-gnu.

======= >>>>>>> 9c8efd5bc4ce0204cb88234db1734f4656a07633

2 R environment

Report generated in 16.89 seconds ( 0.28 minutes) using knitr in RStudio with R version 3.6.3 (2020-02-29) running on x86_64-apple-darwin15.6.0.

2.1 R packages used

  • base R (R Core Team 2016)
  • bookdown (Xie 2018)
  • data.table (Dowle et al. 2015)
  • drake (Landau 2018)
  • ggplot2 (Wickham 2009)
  • here (Müller 2017)
  • knitr (Xie 2016)
  • lubridate (Grolemund and Wickham 2011)
  • rmarkdown (J. Allaire et al. 2020,Xie, Allaire, and Grolemund (2018))
<<<<<<< HEAD

3.2 Session info

## R version 3.6.0 (2019-04-26)
## Platform: x86_64-redhat-linux-gnu (64-bit)
## Running under: Red Hat Enterprise Linux
## 
## Matrix products: default
## BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
=======

2.2 Session info

## R version 3.6.3 (2020-02-29)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS Catalina 10.15.5
## 
## Matrix products: default
## BLAS:   /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
>>>>>>> 9c8efd5bc4ce0204cb88234db1734f4656a07633
## 
## locale:
##  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8       
##  [4] LC_COLLATE=en_GB.UTF-8     LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
##  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                  LC_ADDRESS=C              
## [10] LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] skimr_2.1.1       ggplot2_3.3.1     lubridate_1.7.9   here_0.1          drake_7.12.2     
## [6] data.table_1.12.0 woRkflow_0.1.0   
## 
## loaded via a namespace (and not attached):
<<<<<<< HEAD
##  [1] storr_1.2.1       progress_1.2.2    tidyselect_1.1.0  xfun_0.14         repr_1.1.0       
##  [6] purrr_0.3.4       colorspace_1.4-0  vctrs_0.3.1       generics_0.0.2    viridisLite_0.3.0
## [11] htmltools_0.3.6   yaml_2.2.0        base64enc_0.1-3   utf8_1.1.4        rlang_0.4.6      
## [16] pillar_1.4.4      txtq_0.2.0        glue_1.4.1        withr_2.1.2       lifecycle_0.2.0  
## [21] stringr_1.4.0     munsell_0.5.0     gtable_0.2.0      evaluate_0.14     labeling_0.3     
## [26] knitr_1.28        parallel_3.6.0    fansi_0.4.0       highr_0.7         Rcpp_1.0.1       
## [31] scales_1.0.0      backports_1.1.3   filelock_1.0.2    jsonlite_1.6      hms_0.5.3        
## [36] digest_0.6.25     stringi_1.2.4     bookdown_0.19     dplyr_1.0.0       grid_3.6.0       
## [41] rprojroot_1.3-2   cli_2.0.2         tools_3.6.0       magrittr_1.5      base64url_1.4    
## [46] tibble_3.0.1      tidyr_1.1.0       crayon_1.3.4      pkgconfig_2.0.2   ellipsis_0.3.1   
## [51] prettyunits_1.0.2 assertthat_0.2.0  rmarkdown_2.2     rstudioapi_0.11   R6_2.3.0         
## [56] igraph_1.2.2      compiler_3.6.0
======= ## [1] storr_1.2.1 progress_1.2.2 tidyselect_1.0.0 xfun_0.12 ## [5] repr_1.1.0 purrr_0.3.3 colorspace_1.4-1 vctrs_0.2.4 ## [9] viridisLite_0.3.0 htmltools_0.4.0 yaml_2.2.1 base64enc_0.1-3 ## [13] rlang_0.4.5 pillar_1.4.3 txtq_0.2.0 glue_1.3.2 ## [17] withr_2.1.2 lifecycle_0.2.0 stringr_1.4.0 munsell_0.5.0 ## [21] gtable_0.3.0 evaluate_0.14 labeling_0.3 knitr_1.28 ## [25] parallel_3.6.3 fansi_0.4.1 highr_0.8 Rcpp_1.0.4 ## [29] scales_1.1.0 backports_1.1.5 filelock_1.0.2 jsonlite_1.6.1 ## [33] farver_2.0.3 hms_0.5.3 digest_0.6.25 stringi_1.4.6 ## [37] bookdown_0.18 dplyr_0.8.5 grid_3.6.3 rprojroot_1.3-2 ## [41] cli_2.0.2 tools_3.6.3 magrittr_1.5 base64url_1.4 ## [45] tibble_2.1.3 crayon_1.3.4 pkgconfig_2.0.3 prettyunits_1.1.1 ## [49] assertthat_0.2.1 rmarkdown_2.1 rstudioapi_0.11 R6_2.4.1 ## [53] igraph_1.2.5 compiler_3.6.3
>>>>>>> 9c8efd5bc4ce0204cb88234db1734f4656a07633

References

Allaire, JJ, Yihui Xie, Jonathan McPherson, Javier Luraschi, Kevin Ushey, Aron Atkins, Hadley Wickham, Joe Cheng, Winston Chang, and Richard Iannone. 2020. Rmarkdown: Dynamic Documents for R. https://github.com/rstudio/rmarkdown.

Dowle, M, A Srinivasan, T Short, S Lianoglou with contributions from R Saporta, and E Antonyan. 2015. Data.table: Extension of Data.frame. https://CRAN.R-project.org/package=data.table.

Grolemund, Garrett, and Hadley Wickham. 2011. “Dates and Times Made Easy with lubridate.” Journal of Statistical Software 40 (3): 1–25. http://www.jstatsoft.org/v40/i03/.

Landau, William Michael. 2018. “The Drake R Package: A Pipeline Toolkit for Reproducibility and High-Performance Computing.” Journal of Open Source Software 3 (21). https://doi.org/10.21105/joss.00550.

Müller, Kirill. 2017. Here: A Simpler Way to Find Your Files. https://CRAN.R-project.org/package=here.

R Core Team. 2016. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.

Wickham, Hadley. 2009. Ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. http://ggplot2.org.

Xie, Yihui. 2016. Knitr: A General-Purpose Package for Dynamic Report Generation in R. https://CRAN.R-project.org/package=knitr.

———. 2018. Bookdown: Authoring Books and Technical Documents with R Markdown. https://github.com/rstudio/bookdown.

Xie, Yihui, J.J. Allaire, and Garrett Grolemund. 2018. R Markdown: The Definitive Guide. Boca Raton, Florida: Chapman; Hall/CRC. https://bookdown.org/yihui/rmarkdown.