-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
85 lines (61 loc) · 2.9 KB
/
README.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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
# dfeReports
<!-- badges: start -->
[![R build status](https://github.com/l-hodge/dfeReports/workflows/R-CMD-check/badge.svg)](https://github.com/l-hodge/dfeReports/actions) [![Codecov test coverage](https://codecov.io/gh/l-hodge/dfeReports/branch/main/graph/badge.svg)](https://app.codecov.io/gh/l-hodge/dfeReports/branch/main) [![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
<!-- badges: end -->
## Overview
Write Department for Education (DfE) research reports in Rmarkdown, according to the [template and style guide](https://www.gov.uk/government/publications/research-reports-guide-and-template).
## Installation
```{r, include = TRUE, eval = FALSE}
# install.packages("remotes")
remotes::install_github("l-hodge/dfeReports")
```
## Functions
| Function | Description |
|------------------------------------|------------------------------------|
| `dfe_colours()` | Creates DfE colour palettes, typically monochrome sequential or spectral schemes |
| `dfe_table()` | Wrapper for `knitr::kable` to produce tables in the DfE style |
## Rmarkdown output formats
This package includes two Rmarkdown output formats to produce DfE research reports.
| Function | Description |
|------------------------------------|------------------------------------|
| `basic_report()` | A basic DfE research report based on rmarkdown::pdf_document() |
| `research_report()` | A [bookdown](https://bookdown.org/yihui/bookdown/)-style DfE research report |
### Example yaml
```{yaml, echo = TRUE, eval = FALSE}
---
title: "The title"
month: Month
date: Year
author: "Author1, Author2 and Author3"
affiliation: "Department for Education"
email: "[email protected]"
dferef: "xxxx"
isbn: "xxxx"
output:
dfeReports::research_report:
latex_engine: xelatex
bibliography: biblio.bib
---
```
### Starting from a template
You can start a new report from a template using `rmarkdown::draft()` in the console:
```{r, eval=FALSE}
rmarkdown::draft("ReportName.Rmd", template = "dfe-report-pdf", package = "dfeReports")
```
or in RStudio navigate to R Markdown... \> From Template \> DfE Report Template \> OK
### TinyTeX
You will need to have [`tinytex`](https://yihui.org/tinytex/) installed to render these output formats. The following steps should help you get started:
```{r, eval=FALSE}
# Install package
install.packages("tinytex")
# Install TinyTeX
tinytex::install_tinytex()
# Set CTAN mirror - some of them don't work, this one does(!)
tinytex::tlmgr_repo("http://mirror.aut.ac.nz/CTAN/")
# This is required to get around the DfE proxy
Sys.setenv(no_proxy="*")
```