diff --git a/2020_30_10_EPCs/carbonCosts.Rmd b/2020_30_10_EPCs/carbonCosts.Rmd new file mode 100644 index 0000000000000000000000000000000000000000..0abde92babd917ae6388625050b9b12d86ee9f3b --- /dev/null +++ b/2020_30_10_EPCs/carbonCosts.Rmd @@ -0,0 +1,45 @@ +--- +params: + subtitle: "" + title: "" + authors: "" +title: '`r params$title`' +subtitle: '`r params$subtitle`' +author: '`r params$authors`' +date: 'Last run at: `r Sys.time()`' +output: + bookdown::html_document2: + self_contained: true + fig_caption: yes + code_folding: hide + number_sections: yes + toc: yes + toc_depth: 2 + toc_float: TRUE + bookdown::pdf_document2: + fig_caption: yes + number_sections: yes + bookdown::word_document2: + fig_caption: yes + number_sections: yes + toc: yes + toc_depth: 2 + fig_width: 5 +bibliography: '`r path.expand("~/github/dataknut/refs/refs.bib")`' +--- + +```{r setup, include=FALSE} +knitr::opts_chunk$set(echo = TRUE) + +library(data.table) + +``` + +# R packages used + + * rmarkdown [@rmarkdown] + * bookdown [@bookdown] + * knitr [@knitr] + * data.table [@data.table] + +# References diff --git a/2020_30_10_EPCs/makeFile.R b/2020_30_10_EPCs/makeFile.R new file mode 100644 index 0000000000000000000000000000000000000000..963c5d715d3aaa875ad413c05d3fc981e191bd6f --- /dev/null +++ b/2020_30_10_EPCs/makeFile.R @@ -0,0 +1,25 @@ +makeReport <- function(f){ + # default = html + rmarkdown::render(input = paste0(here::here("2020_30_10_EPCs", f), ".Rmd"), + params = list(title = title, + subtitle = subtitle, + authors = authors), + output_file = paste0(here::here("docs/"), f, ".html") + ) + # word + rmarkdown::render(input = paste0(here::here("2020_30_10_EPCs", f), ".Rmd"), + params = list(title = title, + subtitle = subtitle, + authors = authors), + output_file = paste0(here::here("docs/"), f, ".docx"), + output_format = "word_document" + ) +} + +# >> run report ---- +rmdFile <- "carbonCosts" # not the full path +title = "What can EPC data tell us about the domestic cost of carbon?" +subtitle = "" +authors = "Ben Anderson" + +makeReport(rmdFile) \ No newline at end of file